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

Memcached cache backend #237

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Memcached cache backend #237

wants to merge 2 commits into from

Conversation

wtfrank
Copy link
Contributor

@wtfrank wtfrank commented Sep 26, 2016

Use memcached as a cache (faster than sqlite)

allows individual contracts to be retrieved via the corp or char objects
@coveralls
Copy link

Coverage Status

Coverage remained the same at 97.888% when pulling d78edf3 on wtfrank:memcached into c0f224a on eve-val:master.

@wtfrank
Copy link
Contributor Author

wtfrank commented Sep 26, 2016

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.

Copy link
Member

@ayust ayust left a 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


Copy link
Member

@ayust ayust Sep 27, 2016

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():
Copy link
Member

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.

Copy link
Contributor Author

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

@ayust
Copy link
Member

ayust commented Sep 27, 2016

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 setup.py (and much more minimal).

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.

None yet

3 participants