-- Missing objects use 1, 2, 4, 8, 16, 30, 60 second delays. Loaded objects are validated before reuse. -- Roster resets can restart the schedule at most once every ten seconds. local U=require('ue_observe') local Retry={} function Retry.new(options) options=options or {} local clock=options.clock or os.clock local states,objects={},{} local resetAt local lines=0 local self={} local function say(text) if lines>=96 then return end lines=lines+1 if options.log then options.log(text) end end function self:reset() local now=clock() if resetAt and now-resetAt<10 then return false end resetAt=now local count=0 for _,state in pairs(states)do state.at=0;state.delay=1;count=count+1 end if count>0 then say('重置查询退避 待检查记录='..count..' 下次间隔=1秒') end return true end function self:ready(key) local state=states[key] if not state then state={at=0,delay=1};states[key]=state end local now=clock() if now