chg: reload conf

pull/7939/head
Luciano Righetti 2021-11-09 09:13:25 +01:00
parent 55e9238b46
commit accc6bb9b4
2 changed files with 5 additions and 0 deletions

View File

@ -14,6 +14,8 @@ class MonitorWorkersShell extends AppShell
private const DEFAULT_SLEEP_INTERVAL = 5; // seconds
public $tasks = ['ConfigLoad'];
public function initialize(): void
{
parent::initialize();
@ -41,6 +43,7 @@ class MonitorWorkersShell extends AppShell
CakeLog::info("[WORKERS MONITOR] - starting to monitor workers...");
while (true) {
$this->ConfigLoad->execute();
$this->checkWorkersProcessStatus($this->BackgroundJobsTool->getWorkers());
sleep($this->sleepInterval);

View File

@ -21,6 +21,7 @@ class StartWorkerShell extends AppShell
private const DEFAULT_SLEEP_INTERVAL = 5; // seconds
private const DEFAULT_MAX_EXECUTION_TIME = 86400; // 1 day
public $tasks = ['ConfigLoad'];
public function initialize(): void
{
@ -76,6 +77,7 @@ class StartWorkerShell extends AppShell
$this->BackgroundJobsTool->registerWorker($this->worker);
while (true) {
$this->ConfigLoad->execute();
$this->checkMaxExecutionTime();
$job = $this->BackgroundJobsTool->dequeue($this->worker->queue());