]> git.mxchange.org Git - friendica.git/blobdiff - mod/worker.php
Merge branch 'develop' of https://github.com/Hypolite/friendica into develop
[friendica.git] / mod / worker.php
index 3fb86dd5b2dadf0d82f7cd924c0049c7ad5aab44..4949b830f4866c4863eb5fe99d363e35e06077a6 100644 (file)
@@ -14,6 +14,13 @@ function worker_init($a){
                return;
        }
 
+       // We don't need the following lines if we can execute background jobs.
+       // So we just wake up the worker if it sleeps.
+       if (function_exists("proc_open")) {
+               call_worker_if_idle();
+               return;
+       }
+
        clear_worker_processes();
 
        $workers = q("SELECT COUNT(*) AS `processes` FROM `process` WHERE `command` = 'worker.php'");