mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-22 12:11:26 +00:00
feature(redis): enable key space notifications by default
This commit is contained in:
parent
8d099c9a22
commit
b204d4a9b3
|
@ -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