Merge pull request #11805 from annando/no-standard-decoupling

Decoupling is deactivated by default now
This commit is contained in:
Tobias Diekershoff 2022-07-31 12:25:01 +02:00 committed by GitHub
commit 1ecc2982ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 5 deletions

View File

@ -311,7 +311,9 @@ class Processor
$result = self::fetchMissingActivity($activity['reply-to-id'], $activity, '', Receiver::COMPLETION_AUTO); $result = self::fetchMissingActivity($activity['reply-to-id'], $activity, '', Receiver::COMPLETION_AUTO);
if (empty($result) && self::isActivityGone($activity['reply-to-id'])) { if (empty($result) && self::isActivityGone($activity['reply-to-id'])) {
// Recursively delete this and all depending entries // Recursively delete this and all depending entries
Queue::deleteById($activity['entry-id']); if (!empty($activity['entry-id'])) {
Queue::deleteById($activity['entry-id']);
}
return []; return [];
} }
$fetch_by_worker = empty($result); $fetch_by_worker = empty($result);
@ -366,9 +368,10 @@ class Processor
if (!empty($activity['raw'])) { if (!empty($activity['raw'])) {
$item['source'] = $activity['raw']; $item['source'] = $activity['raw'];
$item['protocol'] = Conversation::PARCEL_ACTIVITYPUB;
} }
$item['protocol'] = Conversation::PARCEL_ACTIVITYPUB;
if (isset($activity['push'])) { if (isset($activity['push'])) {
$item['direction'] = $activity['push'] ? Conversation::PUSH : Conversation::PULL; $item['direction'] = $activity['push'] ? Conversation::PUSH : Conversation::PULL;
} }

View File

@ -583,7 +583,7 @@ class Receiver
$object_data['object_activity'] = $activity; $object_data['object_activity'] = $activity;
} }
if ($trust_source || DI::config()->get('debug', 'ap_inbox_store_untrusted')) { if (DI::config()->get('system', 'decoupled_receiver') && ($trust_source || DI::config()->get('debug', 'ap_inbox_store_untrusted'))) {
$object_data = Queue::add($object_data, $type, $uid, $http_signer, $push, $trust_source); $object_data = Queue::add($object_data, $type, $uid, $http_signer, $push, $trust_source);
} }

View File

@ -93,7 +93,9 @@ class Cron
Queue::clear(); Queue::clear();
// Process all unprocessed entries // Process all unprocessed entries
Queue::processAll(); if (DI::config()->get('system', 'decoupled_receiver')) {
Queue::processAll();
}
// Search for new contacts in the directory // Search for new contacts in the directory
if (DI::config()->get('system', 'synchronize_directory')) { if (DI::config()->get('system', 'synchronize_directory')) {

View File

@ -166,7 +166,7 @@ return [
// decoupled_receiver (Boolean) // decoupled_receiver (Boolean)
// Decouple incoming AP posts by doing the processing in the background. // Decouple incoming AP posts by doing the processing in the background.
'decoupled_receiver' => true, 'decoupled_receiver' => false,
// distributed_cache_driver (database|memcache|memcached|redis) // distributed_cache_driver (database|memcache|memcached|redis)
// Whether to use database, Memcache, Memcached or Redis as a distributed cache. // Whether to use database, Memcache, Memcached or Redis as a distributed cache.