From 07280098d616f55263e579f5b82d6135708f6d93 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Fri, 2 Oct 2020 11:25:57 +0300 Subject: [PATCH] Shifted comment location --- app/workers/functions.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/app/workers/functions.php b/app/workers/functions.php index 99868d432..87c6d1f36 100644 --- a/app/workers/functions.php +++ b/app/workers/functions.php @@ -22,10 +22,10 @@ $environments = Config::getParam('environments'); $warmupStart = \microtime(true); -Co\run(function() use ($environments) { +Co\run(function() use ($environments) { // Warmup: make sure images are ready to run fast 🚀 Swoole\Runtime::enableCoroutine(SWOOLE_HOOK_ALL); - foreach($environments as $environment) { // Warmup: make sure images are ready to run fast 🚀 + foreach($environments as $environment) { go(function() use ($environment) { $stdout = ''; $stderr = ''; @@ -169,7 +169,19 @@ class FunctionsV1 break; case 'schedule': - # code... + /* + * 1. Get Original Task + * 2. Check for updates + * If has updates skip task and don't reschedule + * If status not equal to play skip task + * 3. Check next run date, update task and add new job at the given date + * 4. Execute task (set optional timeout) + * 5. Update task response to log + * On success reset error count + * On failure add error count + * If error count bigger than allowed change status to pause + */ + break; case 'http':