55-- @email 1905333456@qq.com
66
77
8- local cjson = require (" cjson.safe" );
98local tlog = require (" utils.tl_ops_utils_log" ):new (" tl_ops_health_check_version" );
109local tl_ops_utils_func = require (" utils.tl_ops_utils_func" );
1110local tl_ops_constant_health = require (" constant.tl_ops_constant_health" )
12- local cache_dict = ngx .shared .tlopsbalance ;
11+ local shared = ngx .shared .tlopsbalance ;
1312
1413local _M = {
1514 _VERSION = ' 0.02'
@@ -23,15 +22,15 @@ local tl_ops_health_check_version_incr_service_version = function( service_name
2322 return
2423 end
2524 local key = tl_ops_utils_func :gen_node_key (tl_ops_constant_health .cache_key .service_version , service_name )
26- local service_version , _ = cache_dict :get (key )
25+ local service_version , _ = shared :get (key )
2726
2827 if not service_version then
29- service_version , _ = cache_dict :add (key , 1 );
28+ service_version , _ = shared :add (key , 1 );
3029 if not service_version then
3130 tlog :err (" failed to publish new service_version:" , _ )
3231 end
3332 else
34- service_version , _ = cache_dict :incr (key , 1 );
33+ service_version , _ = shared :incr (key , 1 );
3534 if not service_version then
3635 tlog :err (" failed to publish new service_version:" , _ )
3736 end
4645-- 对service_options_version更新,通知timer检查是否有新增service
4746local tl_ops_health_check_version_incr_service_option_version = function ( )
4847 local key = tl_ops_constant_health .cache_key .service_options_version ;
49- local res , _ = cache_dict :set (key , true )
48+ local res , _ = shared :set (key , true )
5049
5150 tlog :dbg (" service_option_version key=" , key , " , service_option_version=" ,res )
5251
0 commit comments