-
Notifications
You must be signed in to change notification settings - Fork 30
Memcached cache backend #237
base: master
Are you sure you want to change the base?
Conversation
allows individual contracts to be retrieved via the corp or char objects
Not quite finished (tests missing) but I have a question: this pull relies on python-memcached, but this caching method is optional. Do I need to put python-memcached into requirements2/3.txt? its currently based on my other pull request, so I assume the commit relating to that will disappear if/when that gets accepted. |
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.
Can you rebase this on top of the new master?
self.mc = memcache.Client(serverList, debug=0) | ||
self.prefix = prefix | ||
|
||
|
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.
Nit: single linebreak between functions.
if not result: | ||
return None | ||
value, expiration = result | ||
if expiration < time.time(): |
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.
How reliable is memcached's built-in expiration? This logic might not be necessary.
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.
it checks the expiry when you request the item so possibly not necessary
For requirements - if it's necessary to run the tests it should be in the requirements file; the deps for users of the library are those in |
Use memcached as a cache (faster than sqlite)