@@ -30,6 +30,7 @@ local _M = {
30
30
working_pool = {}, -- resource_path -> {version = ver, checker = checker}
31
31
waiting_pool = {} -- resource_path -> resource_ver
32
32
}
33
+ local DELAYED_CLEAR_TIMEOUT = 10
33
34
local healthcheck_shdict_name = " upstream-healthcheck"
34
35
local is_http = ngx .config .subsystem == " http"
35
36
if not is_http then
@@ -245,8 +246,8 @@ function _M.timer_working_pool_check()
245
246
for resource_path , item in pairs (working_snapshot ) do
246
247
--- remove from working pool if resource doesn't exist
247
248
local res_conf = fetch_latest_conf (resource_path )
248
- if not res_conf then
249
- item .checker :delayed_clear (10 )
249
+ if not res_conf or not res_conf . value then
250
+ item .checker :delayed_clear (DELAYED_CLEAR_TIMEOUT )
250
251
item .checker :stop ()
251
252
core .log .info (" try to release checker: " , tostring (item .checker ))
252
253
_M .working_pool [resource_path ] = nil
@@ -257,7 +258,7 @@ function _M.timer_working_pool_check()
257
258
core .log .info (" checking working pool for resource: " , resource_path ,
258
259
" current version: " , current_ver , " item version: " , item .version )
259
260
if item .version ~= current_ver then
260
- item .checker :delayed_clear (10 )
261
+ item .checker :delayed_clear (DELAYED_CLEAR_TIMEOUT )
261
262
item .checker :stop ()
262
263
core .log .info (" try to release checker: " , tostring (item .checker ))
263
264
_M .working_pool [resource_path ] = nil
0 commit comments