]> git.mxchange.org Git - friendica.git/commitdiff
Use class constant
authorMichael <heluecht@pirati.ca>
Mon, 26 Sep 2022 13:33:31 +0000 (13:33 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 26 Sep 2022 13:33:31 +0000 (13:33 +0000)
src/Core/Worker.php
static/defaults.config.php

index 036f065d421368677f8608f61034a8df413a0776..69ca6004ceb5d4ece347c20b677c6ed501bab226 100644 (file)
@@ -31,6 +31,13 @@ use Friendica\Util\DateTimeFormat;
  */
 class Worker
 {
+       const PRIORITY_UNDEFINED  = PRIORITY_UNDEFINED;
+       const PRIORITY_CRITICAL   = PRIORITY_CRITICAL;
+       const PRIORITY_HIGH       = PRIORITY_HIGH;
+       const PRIORITY_MEDIUM     = PRIORITY_MEDIUM;
+       const PRIORITY_LOW        = PRIORITY_LOW;
+       const PRIORITY_NEGLIGIBLE = PRIORITY_NEGLIGIBLE;
+
        const STATE_STARTUP    = 1; // Worker is in startup. This takes most time.
        const STATE_LONG_LOOP  = 2; // Worker is processing the whole - long - loop.
        const STATE_REFETCH    = 3; // Worker had refetched jobs in the execution loop.
index b199b055b87a285e7182dfbf92231f90b6c4e7fa..f20b333dd8a4667969c1179bd3093ba88a2e6d62 100644 (file)
@@ -653,11 +653,11 @@ return [
                // worker_max_duration (Array)
                // Maximum runtime per priority. Worker processes that exceed this runtime will be terminated.
                'worker_max_duration' => [
-                       PRIORITY_CRITICAL   => 720,
-                       PRIORITY_HIGH       => 10,
-                       PRIORITY_MEDIUM     => 60,
-                       PRIORITY_LOW        => 180,
-                       PRIORITY_NEGLIGIBLE => 720
+                       Friendica\Core\Worker::PRIORITY_CRITICAL   => 720,
+                       Friendica\Core\Worker::PRIORITY_HIGH       => 10,
+                       Friendica\Core\Worker::PRIORITY_MEDIUM     => 60,
+                       Friendica\Core\Worker::PRIORITY_LOW        => 180,
+                       Friendica\Core\Worker::PRIORITY_NEGLIGIBLE => 720
                ],
 
                // worker_processes_cooldown (Integer)