Merge pull request #6611 from annando/worker-performance

Improved worker performance (changed keys, changed queries)
This commit is contained in:
Hypolite Petovan 2019-02-08 17:46:04 -05:00 committed by GitHub
commit 3aa77685fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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;
}