Skip to content
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

How to use memcache with simplekv/ kv-session? #35

Open
li-gjhawar opened this issue Aug 12, 2015 · 0 comments
Open

How to use memcache with simplekv/ kv-session? #35

li-gjhawar opened this issue Aug 12, 2015 · 0 comments

Comments

@li-gjhawar
Copy link

I am trying to use memcache with simplekv, But as mentioned in the documentation, I get an IO error when I try to clear the cache (during the cleanup_session() part of the code).

from simplekv.memory.memcachestore import MemcacheStore
import memcache
import redis
import datetime

store = RedisStore(redis.StrictRedis())

store = MemcacheStore(memcache.Client(['127.0.0.1:11211'], debug = 0))
store.ttl_support = True
app = create_app(name)
current_kvsession = KVSessionExtension(store, app)
for key in app.kvsession_store.keys():
logger.debug(key)
m = current_kvsession.key_regex.match(key)
logger.debug('found %s', m)
logger.debug(app.kvsession_store.delete(key))

Since memcache doesnt support app.kvsession_store.keys(). Do I need to remember the key somewhere so that I wont have to pull it out of memcache? Let me know if more explaination is needed.

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

No branches or pull requests

1 participant