Update jobs, add retry and timeout attributes

This commit is contained in:
Daniel Supernault 2020-05-22 15:53:59 -06:00
parent 0309f8a4e1
commit 6476855519
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
4 changed files with 17 additions and 1 deletions

View file

@ -31,6 +31,9 @@ class CommentPipeline implements ShouldQueue
*/
public $deleteWhenMissingModels = true;
public $timeout = 5;
public $tries = 1;
/**
* Create a new job instance.
*

View file

@ -28,6 +28,9 @@ class LikePipeline implements ShouldQueue
*/
public $deleteWhenMissingModels = true;
public $timeout = 5;
public $tries = 1;
/**
* Create a new job instance.
*

View file

@ -24,6 +24,9 @@ class NewStatusPipeline implements ShouldQueue
*/
public $deleteWhenMissingModels = true;
public $timeout = 5;
public $tries = 1;
/**
* Create a new job instance.
*

View file

@ -8,6 +8,7 @@ use App\Mention;
use App\Profile;
use App\Status;
use App\StatusHashtag;
use App\Services\PublicTimelineService;
use App\Util\Lexer\Autolink;
use App\Util\Lexer\Extractor;
use DB;
@ -136,7 +137,13 @@ class StatusEntityLexer implements ShouldQueue
public function deliver()
{
if(config('federation.activitypub.enabled') == true) {
$status = $this->status;
if($status->uri == null && $status->scope == 'public') {
PublicTimelineService::add($status->id);
}
if(config('federation.activitypub.enabled') == true && config('app.env') == 'production') {
StatusActivityPubDeliver::dispatch($this->status);
}
}