]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Worker.php
Class file relocations
[friendica.git] / src / Core / Worker.php
index 148b707d14588892c0c8b636103d81d2f3300c19..76bd9fd077f4698d91581ce37096b8514ba85459 100644 (file)
@@ -5,7 +5,7 @@ use Friendica\App;
 use Friendica\Core\System;
 use Friendica\Core\Config;
 use Friendica\Core\Worker;
-use Friendica\Database\Dbm;
+use Friendica\Database\DBM;
 use Friendica\Util\Lock;
 
 use dba;
@@ -142,7 +142,7 @@ class Worker {
         */
        private static function totalEntries() {
                $s = dba::fetch_first("SELECT COUNT(*) AS `total` FROM `workerqueue` WHERE `executed` <= ? AND NOT `done`", NULL_DATE);
-               if (Dbm::is_result($s)) {
+               if (DBM::is_result($s)) {
                        return $s["total"];
                } else {
                        return 0;
@@ -157,7 +157,7 @@ class Worker {
        private static function highestPriority() {
                $condition = array("`executed` <= ? AND NOT `done`", NULL_DATE);
                $s = dba::select('workerqueue', array('priority'), $condition, array('limit' => 1, 'order' => array('priority')));
-               if (Dbm::is_result($s)) {
+               if (DBM::is_result($s)) {
                        return $s["priority"];
                } else {
                        return 0;
@@ -405,7 +405,7 @@ class Worker {
                if ($max == 0) {
                        // the maximum number of possible user connections can be a system variable
                        $r = dba::fetch_first("SHOW VARIABLES WHERE `variable_name` = 'max_user_connections'");
-                       if (Dbm::is_result($r)) {
+                       if (DBM::is_result($r)) {
                                $max = $r["Value"];
                        }
                        // Or it can be granted. This overrides the system variable
@@ -441,7 +441,7 @@ class Worker {
                // We will now check for the system values.
                // This limit could be reached although the user limits are fine.
                $r = dba::fetch_first("SHOW VARIABLES WHERE `variable_name` = 'max_connections'");
-               if (!Dbm::is_result($r)) {
+               if (!DBM::is_result($r)) {
                        return false;
                }
                $max = intval($r["Value"]);
@@ -449,7 +449,7 @@ class Worker {
                        return false;
                }
                $r = dba::fetch_first("SHOW STATUS WHERE `variable_name` = 'Threads_connected'");
-               if (!Dbm::is_result($r)) {
+               if (!DBM::is_result($r)) {
                        return false;
                }
                $used = intval($r["Value"]);
@@ -631,7 +631,7 @@ class Worker {
                                INNER JOIN `workerqueue` ON `workerqueue`.`pid` = `process`.`pid` AND NOT `done`");
 
                // No active processes at all? Fine
-               if (!Dbm::is_result($r)) {
+               if (!DBM::is_result($r)) {
                        return false;
                }
                $priorities = array();
@@ -754,7 +754,7 @@ class Worker {
 
                // There can already be jobs for us in the queue.
                $r = dba::select('workerqueue', array(), array('pid' => getmypid(), 'done' => false));
-               if (Dbm::is_result($r)) {
+               if (DBM::is_result($r)) {
                        self::$db_duration += (microtime(true) - $stamp);
                        return dba::inArray($r);
                }