diff options
author | 2020-09-19 22:01:36 +0200 | |
---|---|---|
committer | 2020-09-19 22:14:48 +0200 | |
commit | 9bb3a4880205e9b24bb839de60ca2f5a26689067 (patch) | |
tree | 0ee125b0f56a00a9e324f537bbab3623dce805b8 | |
parent | Remove vestigial RedisCache class definition (diff) |
Use global namespace `bot` for our RedisSession
As we're now planning on using Redis in multiple applications, it's
important to minimize the risk of namespace collisions between different
applications.
The `async-rediscache` packages allows us to set a global namespace on
an application level. I've chosen "bot" as the namespace for this
application, which means all individual namespaces will automatically be
prefixed by `bot.` whenever they are accessed.
Signed-off-by: Sebastiaan Zeeff <[email protected]>
-rw-r--r-- | bot/__main__.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/bot/__main__.py b/bot/__main__.py index ee627be0a..fb0021d5d 100644 --- a/bot/__main__.py +++ b/bot/__main__.py @@ -33,6 +33,7 @@ redis_session = RedisSession( minsize=1, maxsize=20, use_fakeredis=constants.Redis.use_fakeredis, + global_namespace="bot", ) # Connect redis session to ensure it's connected before we try to access Redis |