EB
Size: a a a
EB
EB
ES
while true do
local task_in_queue = queue.tube.task_queue:take(1)
if task_in_queue ~= nil then
local task
-- Получаем описание задания
local done = true
local delay = 0
if task ~= nil then
log.info('Fiber #%d: Work started for task %d with status %d', fiber_id, task.id_task, task.id_status)
-- провести начальную проверку и назначить аккаунт
done, delay = some_work(task)
end
if done then
queue.tube.task_queue:ack(task_in_queue[1])
else
log.info('Put task back to queue with delay %d', delay)
queue.tube.task_queue:release(task_in_queue[1], {delay=delay})
end
end
fiber.sleep(1)
-- Проверить необходимость остановки
local f = box.space.workers:get{fiber_id}
if f == nil or f[2] == true then
break
end
end
ES
EB
AS
VS
AS
VS
VS
VS
VS
VS
AS
VS
VS
VS
VS
VS
NZ