OPENBUS-3006 Correção para evitar atraso na finalização do 'busservices'

O commit 2edd21cc estava incompleto, foi
feita uma nova revisão na lógica do laço da thread de renovação.
parent d06207f4
......@@ -313,15 +313,17 @@ function AccessControl:__init(data)
end
-- timer de limpeza de credenciais no renovadas e desafios no respondidos
self.sweeper = true -- indicate sweeper shall run
schedule(newthread(function()
while self.sweeper do
local now = time()
local nextDeadline = now + self.leaseTime + self.expirationGap
self.sweeper = newthread(function()
local now = time()
local nextDeadline = time() + self.leaseTime + self.expirationGap
repeat
self.sweeper = running()
waituntil(nextDeadline)
self.sweeper = true
now = time()
nextDeadline = now + self.leaseTime + self.expirationGap
for id, login in self.activeLogins:iLogins() do
local deadline = login.deadline
......@@ -348,8 +350,9 @@ function AccessControl:__init(data)
process:cancel()
end
end
end
end))
until self.sweeper == false
end)
schedule(self.sweeper)
end
function AccessControl:shutdown()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment