]> git.mxchange.org Git - friendica-addons.git/blob - pumpio/pumpio_sync.php
Merge pull request #534 from tobiasd/20180218-en
[friendica-addons.git] / pumpio / pumpio_sync.php
1 <?php
2 use Friendica\Core\Config;
3
4 function pumpio_sync_run(&$argv, &$argc) {
5         global $a;
6
7         require_once("addon/pumpio/pumpio.php");
8
9         if (function_exists('sys_getloadavg')) {
10                 $load = sys_getloadavg();
11                 if (intval($load[0]) > Config::get('system', 'maxloadavg', 50)) {
12                         logger('system: load ' . $load[0] . ' too high. Pumpio sync deferred to next scheduled run.');
13                         return;
14                 }
15         }
16
17         pumpio_sync($a);
18 }