mirror of
https://forgejo.mixinet.net/actions/checkout.git
synced 2025-06-15 14:50:45 -06:00
add options to set max attempts and intervals
This commit is contained in:
parent
2d7d9f7ff5
commit
4dca78049b
8 changed files with 85 additions and 3 deletions
|
@ -55,7 +55,12 @@ export class RetryHelper {
|
|||
}
|
||||
}
|
||||
|
||||
let retryHelper = new RetryHelper()
|
||||
|
||||
export async function execute<T>(action: () => Promise<T>): Promise<T> {
|
||||
const retryHelper = new RetryHelper()
|
||||
return await retryHelper.execute(action)
|
||||
}
|
||||
|
||||
export function config(maxAttempts: number, minSeconds: number, maxSeconds: number): void {
|
||||
retryHelper = new RetryHelper(maxAttempts, minSeconds, maxSeconds)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue