mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-16 20:05:14 +02:00
Refactor Process for new paradigm
This commit is contained in:
parent
0e2e488521
commit
38f70cc55a
14 changed files with 456 additions and 491 deletions
|
@ -196,7 +196,7 @@ while (true) {
|
|||
$do_cron = true;
|
||||
}
|
||||
|
||||
if ($do_cron || (!DI::process()->isMaxLoadReached() && Worker::entriesExists() && Worker::isReady())) {
|
||||
if ($do_cron || (!DI::system()->isMaxLoadReached() && Worker::entriesExists() && Worker::isReady())) {
|
||||
Worker::spawnWorker($do_cron);
|
||||
} else {
|
||||
Logger::info('Cool down for 5 seconds', ['pid' => $pid]);
|
||||
|
|
|
@ -81,8 +81,10 @@ if ($spawn) {
|
|||
|
||||
$run_cron = !array_key_exists('n', $options) && !array_key_exists('no_cron', $options);
|
||||
|
||||
Worker::processQueue($run_cron);
|
||||
$process = DI::process()->create(getmypid());
|
||||
|
||||
Worker::unclaimProcess();
|
||||
Worker::processQueue($run_cron, $process);
|
||||
|
||||
DI::process()->end();
|
||||
Worker::unclaimProcess($process);
|
||||
|
||||
DI::process()->delete($process);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue