1
0
Fork 0

Use typecasting env functions

Many of these environment variables were probably not actually usable,
since they would be strings if set in the env file. Using the
typecasting functions fixes this, and generally shows the intention of
the code more clearly.
This commit is contained in:
Wesley Aptekar-Cassels 2023-03-18 15:23:51 -04:00
parent ded3f469ef
commit b3d3de5374
2 changed files with 11 additions and 11 deletions

View file

@ -6,8 +6,8 @@ from bookwyrm.settings import *
# pylint: disable=line-too-long
REDIS_BROKER_PASSWORD = requests.utils.quote(env("REDIS_BROKER_PASSWORD", ""))
REDIS_BROKER_HOST = env("REDIS_BROKER_HOST", "redis_broker")
REDIS_BROKER_PORT = env("REDIS_BROKER_PORT", 6379)
REDIS_BROKER_DB_INDEX = env("REDIS_BROKER_DB_INDEX", 0)
REDIS_BROKER_PORT = env.int("REDIS_BROKER_PORT", 6379)
REDIS_BROKER_DB_INDEX = env.int("REDIS_BROKER_DB_INDEX", 0)
REDIS_BROKER_URL = env(
"REDIS_BROKER_URL",
f"redis://:{REDIS_BROKER_PASSWORD}@{REDIS_BROKER_HOST}:{REDIS_BROKER_PORT}/{REDIS_BROKER_DB_INDEX}",