将读取配置单独抽出形成parameter API;支持Redis多机备份和故障切换。
This commit is contained in:
5
cache/test/tango_cache_test.c
vendored
5
cache/test/tango_cache_test.c
vendored
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user