mirror of
https://github.com/friendica/friendica
synced 2025-01-09 18:44:44 +00:00
Replace DI::system() with container
This commit is contained in:
parent
aba54ebbbe
commit
11540a8bff
1 changed files with 4 additions and 1 deletions
|
@ -378,6 +378,9 @@ class App
|
||||||
$basePath = $this->container->create(BasePath::class);
|
$basePath = $this->container->create(BasePath::class);
|
||||||
$path = $basePath->getPath();
|
$path = $basePath->getPath();
|
||||||
|
|
||||||
|
/** @var System */
|
||||||
|
$system = $this->container->create(System::class);
|
||||||
|
|
||||||
// Now running as a daemon.
|
// Now running as a daemon.
|
||||||
while (true) {
|
while (true) {
|
||||||
// Check the database structure and possibly fixes it
|
// Check the database structure and possibly fixes it
|
||||||
|
@ -388,7 +391,7 @@ class App
|
||||||
$do_cron = true;
|
$do_cron = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($do_cron || (!DI::system()->isMaxLoadReached() && Worker::entriesExists() && Worker::isReady())) {
|
if ($do_cron || (!$system->isMaxLoadReached() && Worker::entriesExists() && Worker::isReady())) {
|
||||||
Worker::spawnWorker($do_cron);
|
Worker::spawnWorker($do_cron);
|
||||||
} else {
|
} else {
|
||||||
Logger::info('Cool down for 5 seconds', ['pid' => $pid]);
|
Logger::info('Cool down for 5 seconds', ['pid' => $pid]);
|
||||||
|
|
Loading…
Reference in a new issue