use Friendica\BaseObject;
use Friendica\Core\Addon;
use Friendica\Core\Config;
+use Friendica\Core\Hook;
+use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
if ($last) {
$next = $last + ($poll_interval * 60);
if ($next > time()) {
- logger('cron intervall not reached');
+ Logger::log('cron intervall not reached');
return;
}
}
- logger('cron: start');
+ Logger::log('cron: start');
// Fork the cron jobs in separate parts to avoid problems when one of them is crashing
- Addon::forkHooks($a->queue['priority'], "cron");
+ Hook::fork($a->queue['priority'], "cron");
// run queue delivery process in the background
Worker::add(PRIORITY_NEGLIGIBLE, "Queue");
// Poll contacts
self::pollContacts($parameter, $generation);
- logger('cron: end');
+ Logger::log('cron: end');
Config::set('system', 'last_cron', time());
foreach ($contacts as $contact) {
if ($manual_id) {
- $contact['last-update'] = NULL_DATE;
+ $contact['last-update'] = DBA::NULL_DATETIME;
}
// Friendica and OStatus are checked once a day
$priority = PRIORITY_LOW;
}
- logger("Polling " . $contact["network"] . " " . $contact["id"] . " " . $contact['priority'] . " " . $contact["nick"] . " " . $contact["name"]);
+ Logger::log("Polling " . $contact["network"] . " " . $contact["id"] . " " . $contact['priority'] . " " . $contact["nick"] . " " . $contact["name"]);
Worker::add(['priority' => $priority, 'dont_fork' => true], 'OnePoll', (int)$contact['id']);
}