将读取配置单独抽出形成parameter API;支持Redis多机备份和故障切换。

This commit is contained in:
zhangchengwei
2018-11-07 15:05:55 +08:00
committed by zhengchao
parent 1fbaee37a5
commit f1822e04c5
12 changed files with 320 additions and 168 deletions

View File

@@ -398,6 +398,7 @@ int main(int crgc, char **arg)
struct event ev_timer;
struct timeval tv;
void *runtime_log;
struct tango_cache_parameter *parameter;
runtime_log = MESA_create_runtime_log_handle("./runtime.log", 10);
if(NULL==runtime_log)
@@ -414,7 +415,9 @@ int main(int crgc, char **arg)
init_fifo();
tango_cache_global_init();
tango_instance = tango_cache_instance_new(ev_base, "./pangu_tg_cahce.conf", "TANGO_CACHE", runtime_log);
parameter = tango_cache_parameter_new("./pangu_tg_cahce.conf", "TANGO_CACHE", runtime_log);
assert(parameter != NULL);
tango_instance = tango_cache_instance_new(parameter, ev_base, runtime_log);
tv.tv_sec = 10;
tv.tv_usec = 0;