1
1
Fork 0

Added configuration for the bulk delivery

This commit is contained in:
Michael 2022-05-02 17:34:40 +00:00
parent 6e394ac6ff
commit 3163760343
2 changed files with 24 additions and 7 deletions

View file

@ -786,10 +786,17 @@ class Notifier
Logger::info('Delivery via ActivityPub', ['cmd' => $cmd, 'id' => $target_item['id'], 'inbox' => $inbox]); Logger::info('Delivery via ActivityPub', ['cmd' => $cmd, 'id' => $target_item['id'], 'inbox' => $inbox]);
if (Worker::add(['priority' => $priority, 'created' => $created, 'dont_fork' => true], if (DI::config()->get('system', 'bulk_delivery')) {
'APDelivery', $cmd, 0, $inbox, $uid)) { if (Worker::add(['priority' => $priority, 'created' => $created, 'dont_fork' => true],
$delivery_queue_count++; 'APDelivery', $cmd, 0, $inbox, $uid)) {
Post\Delivery::add($target_item['uri-id'], $uid, $inbox, $target_item['created'], $cmd); $delivery_queue_count++;
Post\Delivery::add($target_item['uri-id'], $uid, $inbox, $target_item['created'], $cmd);
}
} else {
if (Worker::add(['priority' => $priority, 'created' => $created, 'dont_fork' => true],
'APDelivery', $cmd, $target_item['id'], $inbox, $uid, $receivers, $target_item['uri-id'])) {
$delivery_queue_count++;
}
} }
} }
@ -797,9 +804,15 @@ class Notifier
foreach ($relay_inboxes as $inbox) { foreach ($relay_inboxes as $inbox) {
Logger::info('Delivery to relay servers via ActivityPub', ['cmd' => $cmd, 'id' => $target_item['id'], 'inbox' => $inbox]); Logger::info('Delivery to relay servers via ActivityPub', ['cmd' => $cmd, 'id' => $target_item['id'], 'inbox' => $inbox]);
if (Worker::add(['priority' => $priority, 'dont_fork' => true], 'APDelivery', $cmd, 0, $inbox, $uid)) { if (DI::config()->get('system', 'bulk_delivery')) {
$delivery_queue_count++; if (Worker::add(['priority' => $priority, 'dont_fork' => true], 'APDelivery', $cmd, 0, $inbox, $uid)) {
Post\Delivery::add($target_item['uri-id'], $uid, $inbox, $target_item['created'], $cmd); $delivery_queue_count++;
Post\Delivery::add($target_item['uri-id'], $uid, $inbox, $target_item['created'], $cmd);
}
} else {
if (Worker::add(['priority' => $priority, 'dont_fork' => true], 'APDelivery', $cmd, $target_item['id'], $inbox, $uid, [], $target_item['uri-id'])) {
$delivery_queue_count++;
}
} }
} }

View file

@ -122,6 +122,10 @@ return [
// Display "Emoji Only" posts in big. // Display "Emoji Only" posts in big.
'big_emojis' => false, 'big_emojis' => false,
// bulk_delivery (Boolean)
// Delivers AP messages in a bulk (experimental)
'bulk_delivery' => false,
// block_local_dir (Boolean) // block_local_dir (Boolean)
// Deny public access to the local user directory. // Deny public access to the local user directory.
'block_local_dir' => false, 'block_local_dir' => false,