Skip to content

Commit

Permalink
chore: remove timers/promises usage (#367)
Browse files Browse the repository at this point in the history
remove timers/promises usage
  • Loading branch information
Hugo Arregui authored Jun 21, 2023
1 parent 9665986 commit 0bbb6a9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/client/utils/retry.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { setTimeout } from 'timers/promises'

export async function retry<T>(
description: string,
execution: () => Promise<T>,
Expand All @@ -17,7 +15,7 @@ export async function retry<T>(
console.info(
`Failed to ${description}. Still have ${attempts} attempt/s left. Will try again in ${waitTimeInMs}`
)
await setTimeout(waitTimeInMs, null)
await new Promise((resolve) => setTimeout(resolve, waitTimeInMs))
} else {
throw error
}
Expand Down

0 comments on commit 0bbb6a9

Please sign in to comment.