Update InboxPipeline

This commit is contained in:
Daniel Supernault 2022-12-19 23:17:24 -07:00
parent 870dbd15df
commit 06c10401c8
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
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;