1
0
Fork 0

Update DeleteWorker pipeline, increase timeout

This commit is contained in:
Daniel Supernault 2022-08-03 22:02:29 -06:00
parent 5ea12601ce
commit 247c9ec5f8
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
1 changed files with 11 additions and 10 deletions

View File

@ -24,8 +24,9 @@ class DeleteWorker implements ShouldQueue
protected $headers; protected $headers;
protected $payload; protected $payload;
public $timeout = 60; public $timeout = 120;
public $tries = 1; public $tries = 3;
public $maxExceptions = 1;
/** /**
* Create a new job instance. * Create a new job instance.
@ -72,7 +73,7 @@ class DeleteWorker implements ShouldQueue
'h:' . hash('sha256', $actor); 'h:' . hash('sha256', $actor);
$lockKey = 'ap:inbox:actor-delete-exists:lock:' . $hash; $lockKey = 'ap:inbox:actor-delete-exists:lock:' . $hash;
Cache::lock($lockKey, 10)->block(5, function () use( Cache::lock($lockKey, 30)->block(15, function () use(
$headers, $headers,
$payload, $payload,
$actor, $actor,
@ -94,30 +95,30 @@ class DeleteWorker implements ShouldQueue
if($profile) { if($profile) {
DeleteRemoteProfilePipeline::dispatch($profile)->onQueue('delete'); DeleteRemoteProfilePipeline::dispatch($profile)->onQueue('delete');
} }
return; return 1;
} else { } else {
// Signature verification failed, exit. // Signature verification failed, exit.
return; return 1;
} }
} else { } else {
// Remote user doesn't exist, exit early. // Remote user doesn't exist, exit early.
return; return 1;
} }
}); });
return; return 1;
} }
$profile = null; $profile = null;
if($this->verifySignature($headers, $payload) == true) { if($this->verifySignature($headers, $payload) == true) {
(new Inbox($headers, $profile, $payload))->handle(); (new Inbox($headers, $profile, $payload))->handle();
return; return 1;
} else if($this->blindKeyRotation($headers, $payload) == true) { } else if($this->blindKeyRotation($headers, $payload) == true) {
(new Inbox($headers, $profile, $payload))->handle(); (new Inbox($headers, $profile, $payload))->handle();
return; return 1;
} else { } else {
return; return 1;
} }
} }