From ad00e0c07dda29015fbe8deb64c420e15ff0d384 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Mon, 27 Aug 2018 20:52:39 +0100 Subject: [PATCH] Make the Redis socket configurable --- conf/example/config.json | 1 + main.py | 6 ++++-- modules/userinfo.py | 1 - 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/conf/example/config.json b/conf/example/config.json index 8918523..93a7527 100644 --- a/conf/example/config.json +++ b/conf/example/config.json @@ -6,6 +6,7 @@ "Key": "key.pem", "Certificate": "cert.pem" }, + "RedisSocket": "/tmp/redis.sock", "UsePassword": true, "ConnectOnCreate": false, "Notifications": { diff --git a/main.py b/main.py index 985bbea..78c11b5 100644 --- a/main.py +++ b/main.py @@ -3,8 +3,6 @@ import redis from utils.loaders.command_loader import loadCommands from utils.logging.log import * -r = redis.StrictRedis(unix_socket_path='/tmp/redis.sock', db=0) - configPath = "conf/" certPath = "cert/" @@ -49,5 +47,9 @@ def initConf(): loadConf(i) def initMain(): + global r initConf() loadCommands(register) + r = redis.StrictRedis(unix_socket_path=config["RedisSocket"], db=0) + + diff --git a/modules/userinfo.py b/modules/userinfo.py index ebb9dda..9814ef0 100644 --- a/modules/userinfo.py +++ b/modules/userinfo.py @@ -14,7 +14,6 @@ def getWho(query): f = getWhoSingle(i, query) if f: result[i] = f - print(result) return result def getNumWhoEntries(name):