Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- self.mc = pylibmc.Client(
- servers=[os.environ.get(MEMCACHE_SERVER_VAR)],
- username=os.environ.get(MEMCACHE_USER_VAR),
- password=os.environ.get(MEMCACHE_PASS_VAR),
- binary=True
- )
- #...
- if (self.mc != None):
- self.mc.set(key, stored_data)
- #...
- page = self.mc.get(key)
- mc = pylibmc.Client(
- servers=[os.environ.get(MEMCACHE_SERVER_VAR)],
- username=os.environ.get(MEMCACHE_USER_VAR),
- password=os.environ.get(MEMCACHE_PASS_VAR),
- binary=True
- )
- self.pool = pylibmc.ThreadMappedPool(mc)
- #...
- if (self.pool != None):
- with self.pool.reserve() as mc:
- mc.set(key, stored_data)
- #...
- if (self.pool != None):
- with self.pool.reserve() as mc:
- page = mc.get(key)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement