Twitter: improved logging

This commit is contained in:
Michael 2020-11-30 21:18:31 +00:00
parent 83df923675
commit 98b1d4990b
2 changed files with 52 additions and 59 deletions

View file

@ -11,8 +11,9 @@ function twitter_sync_run($argv, $argc)
if (function_exists('sys_getloadavg')) {
$load = sys_getloadavg();
if (intval($load[0]) > DI::config()->get('system', 'maxloadavg', 50)) {
Logger::log('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;
}
}