Skip to content

Commit

Permalink
fix: limit job tries (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiio authored Dec 2, 2024
1 parent aadace6 commit 24b0b7a
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 18 deletions.
4 changes: 4 additions & 0 deletions app/Jobs/DeleteTemporaryTableData.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ class DeleteTemporaryTableData implements ShouldQueue, ShouldBeUnique

public int $electionId;

public $tries = 1;

public $failOnTimeout = true;

/**
* Create a new job instance.
*/
Expand Down
4 changes: 4 additions & 0 deletions app/Jobs/PersistTemporaryTableData.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ class PersistTemporaryTableData implements ShouldQueue, ShouldBeUnique
*/
public $timeout = 900;

public $tries = 1;

public $failOnTimeout = true;

/**
* Create a new job instance.
*/
Expand Down
4 changes: 4 additions & 0 deletions app/Jobs/SchedulableJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ abstract class SchedulableJob implements ShouldQueue, ShouldBeUnique

public ScheduledJob $scheduledJob;

public $tries = 1;

public $failOnTimeout = true;

/**
* Create a new job instance.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,7 @@ class ImportAbroadRecordsJob implements ShouldQueue

public ScheduledJob $scheduledJob;

public function tries(): int
{
return 5;
}

public function backoff(): array
{
return [1, 5, 10, 20, 30];
}
public $tries = 1;

public function __construct(ScheduledJob $scheduledJob)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,7 @@ class ImportCountyRecordsJob implements ShouldQueue

public County $county;

public function tries(): int
{
return 5;
}

public function backoff(): array
{
return [1, 5, 10, 20, 30];
}
public $tries = 1;

public function __construct(ScheduledJob $scheduledJob, County $county)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class ImportAbroadRecordsJob implements ShouldQueue, ShouldBeUnique
use Queueable;
use SerializesModels;

public $tries = 1;

public ScheduledJob $scheduledJob;

public function __construct(ScheduledJob $scheduledJob)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class ImportCountyRecordsJob implements ShouldQueue, ShouldBeUnique
use Queueable;
use SerializesModels;

public $tries = 1;

public ScheduledJob $scheduledJob;

public County $county;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class ImportAbroadTurnoutsJob implements ShouldQueue
use Queueable;
use SerializesModels;

public $tries = 1;

public ScheduledJob $scheduledJob;

public function __construct(ScheduledJob $scheduledJob)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class ImportCountyTurnoutsJob implements ShouldQueue
use Queueable;
use SerializesModels;

public $tries = 1;

public ScheduledJob $scheduledJob;

public County $county;
Expand Down

0 comments on commit 24b0b7a

Please sign in to comment.