aboutsummaryrefslogtreecommitdiffstats
path: root/bot/constants.py
diff options
context:
space:
mode:
authorGravatar shtlrs <[email protected]>2023-05-01 14:26:15 +0100
committerGravatar shtlrs <[email protected]>2023-05-06 13:20:46 +0100
commit9b203e6f9eccc71644b76900c2a7b7084d6a240c (patch)
treeb12815c2606967e5e9604a18e357ed8c58f6c401 /bot/constants.py
parentupdate Tokens & Wolfram (diff)
update Redis config
This also renames RedisConfig to Redis, the way we have it in Python
Diffstat (limited to 'bot/constants.py')
-rw-r--r--bot/constants.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/bot/constants.py b/bot/constants.py
index 5f853521..81db539a 100644
--- a/bot/constants.py
+++ b/bot/constants.py
@@ -21,7 +21,7 @@ __all__ = (
"Tokens",
"Wolfram",
"Reddit",
- "RedisConfig",
+ "Redis",
"RedirectOutput",
"PYTHON_PREFIX",
"MODERATION_ROLES",
@@ -321,17 +321,16 @@ class _Wolfram(EnvConfig):
Wolfram = _Wolfram()
-class Wolfram(NamedTuple):
- user_limit_day = int(environ.get("WOLFRAM_USER_LIMIT_DAY", 10))
- guild_limit_day = int(environ.get("WOLFRAM_GUILD_LIMIT_DAY", 67))
- key = environ.get("WOLFRAM_API_KEY")
+class _Redis(EnvConfig):
+ EnvConfig.Config.env_prefix = "redis_"
+ host = "redis.default.svc.cluster.local"
+ port = 6379
+ password = ""
+ use_fakeredis = False
-class RedisConfig(NamedTuple):
- host = environ.get("REDIS_HOST", "redis.default.svc.cluster.local")
- port = environ.get("REDIS_PORT", 6379)
- password = environ.get("REDIS_PASSWORD")
- use_fakeredis = environ.get("USE_FAKEREDIS", "false").lower() == "true"
+
+Redis = _Redis()
class Source: