generated from your-land/yl_template
70 lines
1.4 KiB
Lua
70 lines
1.4 KiB
Lua
-- yl_scheduler.get_task(UUID)
|
|
|
|
local function get_task(UUID)
|
|
local success, tasks = yl_scheduler.list_all_tasks()
|
|
if (success == false) then return nil end
|
|
for key, task in ipairs(tasks)
|
|
if task.id == UUID then
|
|
return true, task
|
|
end
|
|
end
|
|
return nil
|
|
end
|
|
|
|
function yl_scheduler.get_task(UUID)
|
|
return get_task(UUID)
|
|
end
|
|
|
|
-- yl_scheduler.set_task(at, func, params, owner, notes)
|
|
|
|
function yl_scheduler.set_task(at, func, params, owner, notes)
|
|
return set_task(at, func, params, owner, notes)
|
|
end
|
|
|
|
-- yl_scheduler.list_all_tasks()
|
|
|
|
local function list_all_tasks()
|
|
if next(yl_scheduler.tasks) then
|
|
return true, yl_scheduler.tasks
|
|
else
|
|
return false, {}
|
|
end
|
|
end
|
|
|
|
function yl_scheduler.list_all_tasks()
|
|
return list_all_tasks()
|
|
end
|
|
|
|
-- yl_scheduler.list_task(UUID)
|
|
|
|
local function list_task(UUID)
|
|
|
|
end
|
|
|
|
function yl_scheduler.list_task(UUID)
|
|
return list_task(UUID)
|
|
end
|
|
|
|
-- yl_scheduler.remove_task(UUID)
|
|
|
|
function yl_scheduler.remove_task(UUID)
|
|
return remove_task(UUID)
|
|
end
|
|
|
|
-- yl_scheduler.clean_past_tasks()
|
|
|
|
function yl_scheduler.clean_past_tasks()
|
|
return clean_past_tasks()
|
|
end
|
|
|
|
-- yl_scheduler.clean_executed_tasks()
|
|
|
|
function yl_scheduler.clean_executed_tasks()
|
|
return clean_executed_tasks()
|
|
end
|
|
|
|
-- yl_scheduler.execute_task(UUID)
|
|
|
|
function yl_scheduler.execute_task(UUID)
|
|
return execute_task(UUID)
|
|
end |