mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-09 20:53:10 +00:00
feature(redis): enable key space notifications by default
This commit is contained in:
parent
fff8a49992
commit
6510d4cac6
|
@ -29,6 +29,8 @@ class RedisPool:
|
||||||
url,
|
url,
|
||||||
decode_responses=True,
|
decode_responses=True,
|
||||||
)
|
)
|
||||||
|
# TODO: inefficient, this is probably done each time we connect
|
||||||
|
self.get_connection().config_set("notify-keyspace-events", "KEA")
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def connection_url(dbnumber: int) -> str:
|
def connection_url(dbnumber: int) -> str:
|
||||||
|
|
|
@ -15,7 +15,6 @@ STOPWORD = "STOP"
|
||||||
def empty_redis(event_loop):
|
def empty_redis(event_loop):
|
||||||
r = RedisPool().get_connection()
|
r = RedisPool().get_connection()
|
||||||
r.flushdb()
|
r.flushdb()
|
||||||
r.config_set("notify-keyspace-events", "KEA")
|
|
||||||
assert r.config_get("notify-keyspace-events")["notify-keyspace-events"] == "AKE"
|
assert r.config_get("notify-keyspace-events")["notify-keyspace-events"] == "AKE"
|
||||||
yield r
|
yield r
|
||||||
r.flushdb()
|
r.flushdb()
|
||||||
|
|
Loading…
Reference in a new issue