Skip to content

Commit

Permalink
feat: limit number of exceptions within jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
Crypta-Eve authored Jun 26, 2024
1 parent b65e3a5 commit 4e9a48b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Jobs/EsiBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ abstract class EsiBase extends AbstractJob
'invalid_grant: Invalid refresh token. Token missing/expired.',
];

/**
* The maximum number of unhandled exceptions to allow before failing.
*
* @var int
*/
public $maxExceptions = 3;

/**
* @var string By default, queue all ESI jobs on public queue.
*/
Expand Down
12 changes: 12 additions & 0 deletions src/Jobs/Market/History.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ class History extends EsiBase
*/
const ENDPOINT_RATE_LIMIT_CALLS = 100;

/**
* The maximum number of unhandled exceptions to allow before failing.
*
* Override base attempts limit and allow the job to be retried up to 100 times.
* This value is tied to the amount of requests which should be done against ESI
* in order to process a complete batch.
*
*
* @var int
*/
public $maxExceptions = 100;

/**
* @var string
*/
Expand Down

0 comments on commit 4e9a48b

Please sign in to comment.