]> git.mxchange.org Git - friendica.git/blobdiff - bin/daemon.php
Bulk delivery added for all protocols
[friendica.git] / bin / daemon.php
index f1eb077adde604de570dfa1d6e37017b32098425..b7085a490a2679f2012382c6be7c0f12e4449468 100755 (executable)
@@ -45,7 +45,7 @@ $longopts = ['foreground'];
 $options = getopt($shortopts, $longopts);
 
 // Ensure that daemon.php is executed from the base path of the installation
-if (!file_exists('boot.php') && (sizeof($_SERVER['argv']) != 0)) {
+if (!file_exists('index.php') && (sizeof($_SERVER['argv']) != 0)) {
        $directory = dirname($_SERVER['argv'][0]);
 
        if (substr($directory, 0, 1) != '/') {
@@ -76,8 +76,8 @@ DI::config()->load();
 if (empty(DI::config()->get('system', 'pidfile'))) {
        die(<<<TXT
 Please set system.pidfile in config/local.config.php. For example:
-
-    'system' => [
+    
+    'system' => [ 
         'pidfile' => '/path/to/daemon.pid',
     ],
 TXT
@@ -115,7 +115,7 @@ if (is_readable($pidfile)) {
 }
 
 if (empty($pid) && in_array($mode, ['stop', 'status'])) {
-       DI::config()->set('system', 'worker_daemon_mode', false);
+       DI::keyValue()->set('worker_daemon_mode', false);
        die("Pidfile wasn't found. Is the daemon running?\n");
 }
 
@@ -137,7 +137,7 @@ if ($mode == 'stop') {
 
        Logger::notice('Worker daemon process was killed', ['pid' => $pid]);
 
-       DI::config()->set('system', 'worker_daemon_mode', false);
+       DI::keyValue()->set('worker_daemon_mode', false);
        die("Worker daemon process $pid was killed.\n");
 }
 
@@ -181,7 +181,7 @@ if (!$foreground) {
        DBA::connect();
 }
 
-DI::config()->set('system', 'worker_daemon_mode', true);
+DI::keyValue()->set('worker_daemon_mode', true);
 
 // Just to be sure that this script really runs endlessly
 set_time_limit(0);
@@ -199,7 +199,6 @@ while (true) {
        }
 
        if ($do_cron || (!DI::system()->isMaxLoadReached() && Worker::entriesExists() && Worker::isReady())) {
-               Worker::coolDown();
                Worker::spawnWorker($do_cron);
        } else {
                Logger::info('Cool down for 5 seconds', ['pid' => $pid]);