-
Notifications
You must be signed in to change notification settings - Fork 421
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(backoff): change optional BackoffStrategy params to use union (#2365
- Loading branch information
1 parent
8eed71d
commit 29e454a
Showing
3 changed files
with
28 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,30 @@ | ||
import { MinimalJob } from '../interfaces/minimal-job'; | ||
|
||
export type BackoffStrategy = ( | ||
export type BackoffStrategy4 = ( | ||
attemptsMade: number, | ||
type?: string, | ||
err?: Error, | ||
job?: MinimalJob, | ||
type: string, | ||
err: Error, | ||
job: MinimalJob, | ||
) => Promise<number> | number; | ||
|
||
export type BackoffStrategy3 = ( | ||
attemptsMade: number, | ||
type: string, | ||
err: Error, | ||
) => Promise<number> | number; | ||
|
||
export type BackoffStrategy2 = ( | ||
attemptsMade: number, | ||
type: string, | ||
) => Promise<number> | number; | ||
|
||
export type BackoffStrategy1 = (attemptsMade: number) => Promise<number> | number; | ||
|
||
export type BackoffStrategy0 = () => Promise<number> | number; | ||
|
||
export type BackoffStrategy = | ||
| BackoffStrategy4 | ||
| BackoffStrategy3 | ||
| BackoffStrategy2 | ||
| BackoffStrategy1 | ||
| BackoffStrategy0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters