]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Worker.php
Merge pull request #7528 from nupplaphil/bug/fix_locks
[friendica.git] / src / Core / Worker.php
index 709424c5ad318afefefa3bc8cdcdf7a29453936c..037590c90d7783e025bdf492353114b34972bb73 100644 (file)
@@ -5,6 +5,7 @@
 namespace Friendica\Core;
 
 use Friendica\BaseObject;
+use Friendica\Core;
 use Friendica\Database\DBA;
 use Friendica\Model\Process;
 use Friendica\Util\DateTimeFormat;
@@ -1082,7 +1083,9 @@ class Worker
 
                $args = ['no_cron' => !$do_cron];
 
-               get_app()->proc_run($command, $args);
+               $a = get_app();
+               $process = new Core\Process($a->getLogger(), $a->getMode(), $a->getConfig(), $a->getBasePath());
+               $process->run($command, $args);
 
                // after spawning we have to remove the flag.
                if (Config::get('system', 'worker_daemon_mode', false)) {
@@ -1124,7 +1127,7 @@ class Worker
 
                $priority = PRIORITY_MEDIUM;
                // Don't fork from frontend tasks by default
-               $dont_fork = Config::get("system", "worker_dont_fork", false) || !\get_app()->isBackend();
+               $dont_fork = Config::get("system", "worker_dont_fork", false) || !\get_app()->getMode()->isBackend();
                $created = DateTimeFormat::utcNow();
                $force_priority = false;