-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change cache key to account for key's modification time. #2
base: master
Are you sure you want to change the base?
Conversation
Thanks for the pull request! I took a quick look and looks reasonable to me, I will finish reviewing as soon as I can. |
|
||
b = conn.get_bucket(bucket) | ||
k = b.get_key(key) | ||
if k == None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if k is None:
if k == None: | ||
return None | ||
m.update(bucket+key+k.last_modified) | ||
cache_key=m.hexdigest() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
space around =
b = conn.get_bucket(bucket) | ||
k = b.get_key(key) | ||
if k == None: | ||
return None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should log.warn
too.
k = b.get_key(key) | ||
if k == None: | ||
return None | ||
m.update(bucket+key+k.last_modified) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spaces around +
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! I have a few minor requested changes.
This change incorporates the key's last modification time in S3 into the local cache key. An alternative implementation would be to compare the last modification time to the time of the current request, but this seems more efficient.