Merge pull request #3976 from pixelfed/staging

Update InboxPipeline
This commit is contained in:
daniel 2022-12-19 23:19:11 -07:00 committed by GitHub
commit d384ae3669
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -17,6 +17,7 @@ use Illuminate\Queue\SerializesModels;
use App\Jobs\DeletePipeline\DeleteRemoteProfilePipeline;
use Illuminate\Support\Facades\Http;
use Illuminate\Http\Client\ConnectionException;
use Illuminate\Support\Lottery;
class InboxValidator implements ShouldQueue
{
@ -81,7 +82,8 @@ class InboxValidator implements ShouldQueue
if(isset($payload['type']) && in_array($payload['type'], ['Follow', 'Accept']) ) {
ActivityHandler::dispatch($headers, $profile, $payload)->onQueue('follow');
} else {
ActivityHandler::dispatch($headers, $profile, $payload)->onQueue('inbox');
$onQueue = Lottery::odds(1, 12)->winner(fn () => 'high')->loser(fn () => 'inbox')->choose();
ActivityHandler::dispatch($headers, $profile, $payload)->onQueue($onQueue);
}
return;
} else {

View file

@ -66,7 +66,7 @@ class InboxWorker implements ShouldQueue
}
if($this->verifySignature($headers, $payload) == true) {
ActivityHandler::dispatch($headers, $profile, $payload)->onQueue('inbox');
ActivityHandler::dispatch($headers, $profile, $payload)->onQueue('shared');
return;
} else {
return;