将读取配置单独抽出形成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

@@ -280,6 +280,7 @@ int main(int argc, char **argv)
pthread_t thread_tid;
pthread_attr_t attr;
struct pthread_data pdata[20];
struct tango_cache_parameter *parameter;
if(argc!=3)
{
@@ -294,7 +295,9 @@ int main(int argc, char **argv)
}
cache_evbase_global_init();
instance_asyn = cache_evbase_instance_new("./pangu_tg_cahce.conf", "TANGO_CACHE", runtime_log);
parameter = cache_evbase_parameter_new("./pangu_tg_cahce.conf", "TANGO_CACHE", runtime_log);
assert(parameter != NULL);
instance_asyn = cache_evbase_instance_new(parameter, runtime_log);
assert(instance_asyn!=NULL);
pthread_attr_init(&attr);