advancedcontentfilter: Add language values to filter fields (#10052, #10136)
[friendica-addons.git/.git] / twitter / twitter_sync.php
index 7ff3dbb..092a61e 100644 (file)
@@ -1,17 +1,19 @@
 <?php
 
-use Friendica\Core\Config;
+use Friendica\Core\Logger;
+use Friendica\DI;
 
 function twitter_sync_run($argv, $argc)
 {
-       global $a;
+       $a = Friendica\DI::app();
 
        require_once 'addon/twitter/twitter.php';
 
        if (function_exists('sys_getloadavg')) {
                $load = sys_getloadavg();
-               if (intval($load[0]) > Config::get('system', 'maxloadavg', 50)) {
-                       logger('system: load ' . $load[0] . ' too high. Twitter sync deferred to next scheduled run.');
+               $maxload = DI::config()->get('system', 'maxloadavg', 50);
+               if (intval($load[0]) > $maxload) {
+                       Logger::notice('load too high. Twitter sync deferred to next scheduled run.', ['current' => $load[0], 'max' => $maxload]);
                        return;
                }
        }