persistence for recurring api calls
All checks were successful
Build and push docker image / Build (pull_request) Successful in 1m48s
All checks were successful
Build and push docker image / Build (pull_request) Successful in 1m48s
This commit is contained in:
18
backend/src/persistence.py
Normal file
18
backend/src/persistence.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from pymemcache.client.base import Client
|
||||
|
||||
import constants
|
||||
|
||||
|
||||
class DummyClient:
|
||||
_data = {}
|
||||
def set(self, key, value, **kwargs):
|
||||
self._data[key] = value
|
||||
|
||||
def get(self, key, **kwargs):
|
||||
return self._data[key]
|
||||
|
||||
|
||||
if constants.MEMCACHE_HOST is None:
|
||||
client = DummyClient()
|
||||
else:
|
||||
client = Client(constants.MEMCACHE_HOST, timeout=1)
|
Reference in New Issue
Block a user