mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 22:41:27 +00:00
Update AP deliver job
This commit is contained in:
parent
4bfe30e5b5
commit
691cc991c6
1 changed files with 3 additions and 2 deletions
|
@ -76,7 +76,7 @@ class StatusActivityPubDeliver implements ShouldQueue
|
||||||
'timeout' => config('pixelfed.ap_delivery_timeout')
|
'timeout' => config('pixelfed.ap_delivery_timeout')
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$requests = function() use ($audience, $client, $activity, $profile, $payload) {
|
$requests = function($audience) use ($client, $activity, $profile, $payload) {
|
||||||
foreach($audience as $url) {
|
foreach($audience as $url) {
|
||||||
$headers = HttpSignature::sign($profile, $url, $activity);
|
$headers = HttpSignature::sign($profile, $url, $activity);
|
||||||
yield function() use ($client, $url, $headers, $payload) {
|
yield function() use ($client, $url, $headers, $payload) {
|
||||||
|
@ -91,7 +91,7 @@ class StatusActivityPubDeliver implements ShouldQueue
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$pool = new Pool($client, $requests, [
|
$pool = new Pool($client, $requests($audience), [
|
||||||
'concurrency' => config('pixelfed.ap_delivery_concurrency'),
|
'concurrency' => config('pixelfed.ap_delivery_concurrency'),
|
||||||
'fulfilled' => function ($response, $index) {
|
'fulfilled' => function ($response, $index) {
|
||||||
Log::info('AP:deliver:success - ' . json_encode($response));
|
Log::info('AP:deliver:success - ' . json_encode($response));
|
||||||
|
@ -100,6 +100,7 @@ class StatusActivityPubDeliver implements ShouldQueue
|
||||||
Log::info('AP:deliver:rejected - ' . json_encode($reason));
|
Log::info('AP:deliver:rejected - ' . json_encode($reason));
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$promise = $pool->promise();
|
$promise = $pool->promise();
|
||||||
|
|
||||||
$promise->wait();
|
$promise->wait();
|
||||||
|
|
Loading…
Reference in a new issue