Sentinel id could be removed safely from the config

Removing the sentinel_master_id property from the cdb_conf
redis config, the extension is going to use a single redis instance
instead of Sentinel
This commit is contained in:
Mario de Frutos
2016-02-24 17:22:42 +01:00
parent df195a9539
commit 9a36445661
3 changed files with 21 additions and 6 deletions

View File

@@ -13,13 +13,18 @@ RETURNS cdb_dataservices_server._redis_conf_params AS $$
else:
import json
params = json.loads(conf)
return {
"sentinel_master_id": params['sentinel_master_id'],
redis_conf_params = {
"redis_host": params['redis_host'],
"redis_port": params['redis_port'],
"timeout": params['timeout'],
"redis_db": params['redis_db']
}
if "sentinel_master_id" in params:
redis_conf_params["sentinel_master_id"] = params["sentinel_master_id"]
else:
redis_conf_params["sentinel_master_id"] = None
return redis_conf_params
$$ LANGUAGE plpythonu;
-- Get the connection to redis from cache or create a new one

View File

@@ -92,13 +92,18 @@ RETURNS cdb_dataservices_server._redis_conf_params AS $$
else:
import json
params = json.loads(conf)
return {
"sentinel_master_id": params['sentinel_master_id'],
redis_conf_params = {
"redis_host": params['redis_host'],
"redis_port": params['redis_port'],
"timeout": params['timeout'],
"redis_db": params['redis_db']
}
if "sentinel_master_id" in params:
redis_conf_params["sentinel_master_id"] = params["sentinel_master_id"]
else:
redis_conf_params["sentinel_master_id"] = None
return redis_conf_params
$$ LANGUAGE plpythonu;
-- Get the connection to redis from cache or create a new one

View File

@@ -16,13 +16,18 @@ RETURNS cdb_dataservices_server._redis_conf_params AS $$
else:
import json
params = json.loads(conf)
return {
"sentinel_master_id": params['sentinel_master_id'],
redis_conf_params = {
"redis_host": params['redis_host'],
"redis_port": params['redis_port'],
"timeout": params['timeout'],
"redis_db": params['redis_db']
}
if "sentinel_master_id" in params:
redis_conf_params["sentinel_master_id"] = params["sentinel_master_id"]
else:
redis_conf_params["sentinel_master_id"] = None
return redis_conf_params
$$ LANGUAGE plpythonu;
-- Get the connection to redis from cache or create a new one