Improved worker performance (changed keys, changed queries)

This commit is contained in:
Michael 2019-02-08 21:48:41 +00:00
parent 616932c8db
commit 5e5a2c3cc1
3 changed files with 75 additions and 53 deletions

View file

@ -138,18 +138,27 @@ class OnePoll
// We don't poll our followers
if ($contact["rel"] == Contact::FOLLOWER) {
Logger::log("Don't poll follower");
// set the last-update so we don't keep polling
DBA::update('contact', ['last-update' => DateTimeFormat::utcNow()], ['id' => $contact['id']]);
return;
}
// Don't poll if polling is deactivated (But we poll feeds and mails anyway)
if (!in_array($contact['network'], [Protocol::FEED, Protocol::MAIL]) && Config::get('system', 'disable_polling')) {
Logger::log('Polling is disabled');
// set the last-update so we don't keep polling
DBA::update('contact', ['last-update' => DateTimeFormat::utcNow()], ['id' => $contact['id']]);
return;
}
// We don't poll AP contacts by now
if ($contact['network'] === Protocol::ACTIVITYPUB) {
Logger::log("Don't poll AP contact");
// set the last-update so we don't keep polling
DBA::update('contact', ['last-update' => DateTimeFormat::utcNow()], ['id' => $contact['id']]);
return;
}