Skip to content

Commit bc4b9b5

Browse files
committed
initialise health_check once
1 parent 6c7fbfe commit bc4b9b5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/resty/rediscluster.lua

+4-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ local function health_check_timer(premature)
8585
end
8686
end
8787

88-
ngx.timer.every(1, health_check_timer)
89-
9088
local function track_node_failure(ip, port, name)
9189
local health_dict = ngx.shared[DEFAULT_HEALTH_DICT_NAME]
9290
if not health_dict then
@@ -922,4 +920,8 @@ setmetatable(_M, {
922920
end
923921
})
924922

923+
function _M.init()
924+
ngx.timer.every(1, health_check_timer)
925+
end
926+
925927
return _M

0 commit comments

Comments
 (0)