]> git.mxchange.org Git - friendica.git/blobdiff - include/poller.php
Merge pull request #3227 from annando/1703-pdo
[friendica.git] / include / poller.php
index e8bfb88389aebcb08355d5792df373f89b6a9d07..82befae51842dc4bd1dd49c2f5f3dabeaa144216 100644 (file)
@@ -11,7 +11,6 @@ if (!file_exists("boot.php") AND (sizeof($_SERVER["argv"]) != 0)) {
 }
 
 use \Friendica\Core\Config;
-use \Friendica\Core\PConfig;
 
 require_once("boot.php");
 
@@ -29,6 +28,8 @@ function poller_run($argv, $argc){
                unset($db_host, $db_user, $db_pass, $db_data);
        };
 
+       Config::load();
+
        // Quit when in maintenance
        if (Config::get('system', 'maintenance', true)) {
                return;
@@ -206,6 +207,16 @@ function poller_exec_function($queue, $funcname, $argv) {
 
        $duration = number_format(microtime(true) - $stamp, 3);
 
+       if ($duration > 3600) {
+               logger("Prio ".$queue["priority"].": ".$queue["parameter"]." - longer than 1 hour (".round($duration/60, 3).")", LOGGER_DEBUG);
+       } elseif ($duration > 600) {
+               logger("Prio ".$queue["priority"].": ".$queue["parameter"]." - longer than 10 minutes (".round($duration/60, 3).")", LOGGER_DEBUG);
+       } elseif ($duration > 300) {
+               logger("Prio ".$queue["priority"].": ".$queue["parameter"]." - longer than 5 minutes (".round($duration/60, 3).")", LOGGER_DEBUG);
+       } elseif ($duration > 120) {
+               logger("Prio ".$queue["priority"].": ".$queue["parameter"]." - longer than 2 minutes (".round($duration/60, 3).")", LOGGER_DEBUG);
+       }
+
        logger("Process ".$mypid." - Prio ".$queue["priority"]." - ID ".$queue["id"].": ".$funcname." - done in ".$duration." seconds.");
 
        // Write down the performance values into the log