script.loaded = true
end
- script.servers_ready = nil -- Allow further reload
+ script.pending_upload = false -- Allow further reload
local wait_table = {}
for _, s in ipairs(script.waitq) do
if is_all_servers_ready(script) then
script_set_loaded(script)
elseif is_all_servers_failed(script) then
+ script.pending_upload = false
script.fatal_error = "cannot upload script to any server"
end
end -- callback
if is_all_servers_ready(script) then
script_set_loaded(script)
elseif is_all_servers_failed(script) then
+ script.pending_upload = false
script.fatal_error = "cannot upload script to any server"
end
end
if is_all_servers_ready(script) then
script_set_loaded(script)
elseif is_all_servers_failed(script) then
+ script.pending_upload = false
script.fatal_error = "cannot upload script to any server"
end
end
if is_all_servers_ready(script) then
script_set_loaded(script)
elseif is_all_servers_failed(script) then
+ script.pending_upload = false
script.fatal_error = "cannot upload script " .. script_description(script) .. " to any server"
end
end
-- Schedule restart if possible
if can_reload then
table.insert(script.waitq, do_call)
- if not script.servers_ready then
+ if not script.pending_upload then
logger.infox(params.task or rspamd_config,
'redis script %s is not loaded (NOSCRIPT returned), scheduling reload',
script_description(script))
script.sha = nil
script.loaded = nil
+ script.pending_upload = true
-- Reload scripts if this has not been initiated yet
if params.task then
load_script_task(script, params.task)