Wait for parent

pull/9752/head
Michael 2021-01-05 16:47:55 +00:00
parent 17fbe5c299
commit 2f8e873cc7
1 changed files with 7 additions and 3 deletions

View File

@ -1234,9 +1234,13 @@ class Worker
// We now are in the new worker
DBA::connect();
/// @todo Reinitialize the logger to set a new process_id and uid
self::IPCSetJobState(true, getmypid());
Logger::info('Worker spawned', ['pid' => getmypid()]);
$cycles = 0;
while (!self::IPCJobsExists($pid) && (++$cycles < 100)) {
usleep(10000);
}
Logger::info('Worker spawned', ['pid' => getmypid(), 'wait_cycles' => $cycles]);
self::processQueue($do_cron);