addressing comments

This commit is contained in:
shimon 2022-11-10 21:07:27 +02:00
parent 745ae7a4c8
commit 3dc619f57d
2 changed files with 6 additions and 4 deletions

View file

@ -15,6 +15,7 @@ const FUNCTION_ENQUEUE_TIMER = 60; //seconds
const FUNCTION_ENQUEUE_TIMEFRAME = 60 * 5; // 5 min
sleep(4);
/**
* 1. first load from db with limit+offset
* 2. creating a 5-min offset array ($queue)
@ -106,7 +107,8 @@ $cli
/**
* The timer updates $functions from db on last resourceUpdatedAt attr in X-min.
*/
Co\run(
function () use ($removeFromQueue, $createQueue, $dbForConsole, &$functions, &$queue, &$lastUpdate) {
Timer::tick(FUNCTION_UPDATE_TIMER * 1000, function () use ($removeFromQueue, $createQueue, $dbForConsole, &$functions, &$queue, &$lastUpdate) {
$time = DateTime::now();
$limit = 1000;
@ -197,6 +199,6 @@ $cli
$timerEnd = \microtime(true);
Console::info("Queue timer: finished in " . ($timerEnd - $timerStart) . " seconds");
});
}
);
});

View file

@ -61,7 +61,7 @@
"utopia-php/websocket": "0.1.0",
"utopia-php/image": "0.5.*",
"utopia-php/orchestration": "0.6.*",
"utopia-php/pools": "dev-feat-optimize-filling as 0.3.0",
"utopia-php/pools": "0.4.0",
"resque/php-resque": "1.3.6",
"matomo/device-detector": "6.0.0",
"dragonmantank/cron-expression": "3.3.1",