X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fworker.php;h=00cb6699d1b2a484e57ae0f5729fd1f92868b743;hb=620395378e2397de1a99877b2ebcf917742807d2;hp=f540010bd64102b0e2f21f1517bd6a6851f530b9;hpb=31768c868bf8c5f9899a5d98382f8cfd87b3a23a;p=friendica.git diff --git a/mod/worker.php b/mod/worker.php index f540010bd6..00cb6699d1 100644 --- a/mod/worker.php +++ b/mod/worker.php @@ -1,14 +1,17 @@ start_process(); + Worker::startProcess(); - logger("Front end worker started: ".getmypid()); + Logger::log("Front end worker started: ".getmypid()); Worker::callWorker(); if ($r = Worker::workerProcess()) { - // On most configurations this parameter wouldn't have any effect. // But since it doesn't destroy anything, we just try to get more execution time in any way. set_time_limit(0); - if (poller_claim_process($r[0])) { + $fields = ['executed' => DateTimeFormat::utcNow(), 'pid' => getmypid(), 'done' => false]; + $condition = ['id' => $r[0]["id"], 'pid' => 0]; + if (DBA::update('workerqueue', $fields, $condition)) { Worker::execute($r[0]); } } @@ -50,9 +54,9 @@ function worker_init($a){ Worker::unclaimProcess(); - $a->end_process(); + Worker::endProcess(); - logger("Front end worker ended: ".getmypid()); + Logger::log("Front end worker ended: ".getmypid()); killme(); }