Skip to content
This repository has been archived by the owner on May 11, 2021. It is now read-only.

Fix missed remote cache updates #25

Closed
wants to merge 4 commits into from

Conversation

maxiberta
Copy link

Hi. This extends #20 by fixing a few extra issues that where causing web server processes to usually miss cache updates while processing several requests per second (see https://github.com/YPlan/gargoyle/issues/83). The fixed issues are:

  • CachedDict._local_last_updated being set even if local_cache was not updated (similar to Improve calculation of local cache expiration #20), which may affect calculation of CachedDict.local_cache_is_invalid().
  • Time comparison in CachedDict.local_cache_is_invalid() would return a false negative if remote cache is updated within the same second as CachedDict._local_last_updated, due to time being rounded as int(). The chances of this were made bigger by the previous issue together with the request_finished handler constantly expiring the local cache.
  • Failing tests crashing due to undefined model variable in CachedDict.__repr__().

@maxiberta maxiberta changed the title Fix missed invalid Fix missed remote cache updates Jun 20, 2016
@adamchainz adamchainz self-assigned this Jul 24, 2016
@adamchainz
Copy link
Owner

Sorry about slow review, thanks very much for this! Merged in dc8ea28 .

@adamchainz adamchainz closed this Jul 31, 2016
@adamchainz
Copy link
Owner

adamchainz commented Jul 31, 2016

And released on PyPI at 1.5.2: https://pypi.python.org/pypi/django-modeldict-yplan

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants