Implement the RedisConfigStorage
This commit is contained in:
+7
-5
@@ -25,13 +25,15 @@ class InMemoryConfigStorage(ConfigStorageInterface):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
# TODO move out of this file. In general this is config but either user or org config
|
||||||
class RedisConfigStorage(ConfigStorageInterface):
|
class RedisConfigStorage(ConfigStorageInterface):
|
||||||
|
|
||||||
def __init__(self, connection, prefix):
|
def __init__(self, connection, config_key):
|
||||||
self._connection = connection
|
self._connection = connection
|
||||||
self._prefix = prefix
|
self._config_key = config_key
|
||||||
|
self._data = None
|
||||||
|
|
||||||
def get(self, key):
|
def get(self, key):
|
||||||
# TODO: Implement. this is just a stub
|
if not self._data:
|
||||||
return None
|
self._data = self._connection.hgetall(self._config_key)
|
||||||
|
return self._data[key]
|
||||||
|
|||||||
Reference in New Issue
Block a user