Skip to content

Commit

Permalink
Merge pull request #3 from mwek/patch-1
Browse files Browse the repository at this point in the history
UpdateStatuses: Fix KeyError in mark_being_updated
  • Loading branch information
zmumi authored Jan 27, 2020
2 parents bd35641 + ca094a2 commit a6a25a5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.0.3
-----

* Fixed unhandled KeyError in UpdateStatuses.

1.0.2
-----

Expand Down
2 changes: 2 additions & 0 deletions memoize/statuses.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def mark_being_updated(self, key: CacheKey) -> None:
self._updates_in_progress[key] = future

def complete_on_timeout_passed():
if key not in self._updates_in_progress:
return
if self._updates_in_progress[key] == future and not self._updates_in_progress[key].done():
self.logger.debug('Update task timed out - notifying clients awaiting for key %s', key)
self._updates_in_progress[key].set_result(None)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def prepare_description():

setup(
name='py-memoize',
version='1.0.2',
version='1.0.3',
author='Michal Zmuda',
author_email='[email protected]',
url='https://github.com/DreamLab/memoize',
Expand Down

0 comments on commit a6a25a5

Please sign in to comment.