mirror of
https://github.com/friendica/friendica
synced 2024-11-19 17:43:40 +00:00
Fix PID at forking
This commit is contained in:
parent
32f0c3fb9c
commit
a7487ee50d
1 changed files with 5 additions and 5 deletions
|
@ -1183,22 +1183,22 @@ class Worker
|
||||||
DBA::connect();
|
DBA::connect();
|
||||||
|
|
||||||
DI::flushLogger();
|
DI::flushLogger();
|
||||||
$process = DI::process()->create($pid);
|
$process = DI::process()->create(getmypid());
|
||||||
|
|
||||||
$cycles = 0;
|
$cycles = 0;
|
||||||
while (!self::IPCJobsExists($pid) && (++$cycles < 100)) {
|
while (!self::IPCJobsExists($process->pid) && (++$cycles < 100)) {
|
||||||
usleep(10000);
|
usleep(10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger::info('Worker spawned', ['pid' => $pid, 'wait_cycles' => $cycles]);
|
Logger::info('Worker spawned', ['pid' => $process->pid, 'wait_cycles' => $cycles]);
|
||||||
|
|
||||||
self::processQueue($do_cron, $process);
|
self::processQueue($do_cron, $process);
|
||||||
|
|
||||||
self::unclaimProcess($process);
|
self::unclaimProcess($process);
|
||||||
|
|
||||||
self::IPCSetJobState(false, $pid);
|
self::IPCSetJobState(false, $process->pid);
|
||||||
DI::process()->delete($process);
|
DI::process()->delete($process);
|
||||||
Logger::info('Worker ended', ['pid' => $pid]);
|
Logger::info('Worker ended', ['pid' => $process->pid]);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue