Make the Redis socket configurable

This commit is contained in:
Mark Veidemanis 2018-08-27 20:52:39 +01:00
parent 36105c7e9a
commit ad00e0c07d
3 changed files with 5 additions and 3 deletions

View File

@ -6,6 +6,7 @@
"Key": "key.pem", "Key": "key.pem",
"Certificate": "cert.pem" "Certificate": "cert.pem"
}, },
"RedisSocket": "/tmp/redis.sock",
"UsePassword": true, "UsePassword": true,
"ConnectOnCreate": false, "ConnectOnCreate": false,
"Notifications": { "Notifications": {

View File

@ -3,8 +3,6 @@ import redis
from utils.loaders.command_loader import loadCommands from utils.loaders.command_loader import loadCommands
from utils.logging.log import * from utils.logging.log import *
r = redis.StrictRedis(unix_socket_path='/tmp/redis.sock', db=0)
configPath = "conf/" configPath = "conf/"
certPath = "cert/" certPath = "cert/"
@ -49,5 +47,9 @@ def initConf():
loadConf(i) loadConf(i)
def initMain(): def initMain():
global r
initConf() initConf()
loadCommands(register) loadCommands(register)
r = redis.StrictRedis(unix_socket_path=config["RedisSocket"], db=0)

View File

@ -14,7 +14,6 @@ def getWho(query):
f = getWhoSingle(i, query) f = getWhoSingle(i, query)
if f: if f:
result[i] = f result[i] = f
print(result)
return result return result
def getNumWhoEntries(name): def getNumWhoEntries(name):