Commit 8ff7a770 authored by arun.uday's avatar arun.uday

redis hostname and db changed to conf file

parent 872b1396
......@@ -25,3 +25,9 @@ requests = 60
[encode]
encode = utf-8
[redis]
host_name = 127.0.0.1
redis_1 = 0
redis_2 = 1
redis_3 = 2
\ No newline at end of file
......@@ -27,5 +27,11 @@ try:
# encode
utf_encode = config.get("encode", "encode")
# redis
redis_host = config.get("redis", "host_name")
redis_db1 = config.get("redis", "redis_1")
redis_db2 = config.get("redis", "redis_2")
redis_db3 = config.get("redis", "redis_3")
except Exception as e:
print(e)
import redis
from scripts.config import applications_config
from scripts.logging.loggers import logger
try:
# gold seats database on redis
conn_good = redis.Redis('127.0.0.1', db=0)
conn_maintenance = redis.Redis('127.0.0.1', db=1)
conn_error = redis.Redis('127.0.0.1', db=2)
conn_good = redis.Redis(applications_config.redis_host, db=int(applications_config.redis_db1))
conn_maintenance = redis.Redis(applications_config.redis_host, db=int(applications_config.redis_db2))
conn_error = redis.Redis(applications_config.redis_host, db=int(applications_config.redis_db3))
except Exception as e:
logger.error("Exception occurred: ", e)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment