Skip to content

Commit

Permalink
mention retry in updates
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Jun 10, 2024
1 parent 81d5ce4 commit a2a2ba2
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/core/src/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
FETCH_RETRY_MAX_DELAY_DEFAULT,
} from "./constants"
import { errorMessage } from "./error"
import { toStringList } from "./util"
import { logVerbose, toStringList } from "./util"

export async function createFetch(
options?: {
Expand Down Expand Up @@ -37,13 +37,12 @@ export async function createFetch(
return undefined
const message = errorMessage(error)
const delay = Math.min(maxDelay, Math.pow(2, attempt) * retryDelay)
trace?.resultItem(
false,
toStringList(
message,
`retry #${attempt + 1} in ${Math.floor(delay) / 1000}s`
)
const msg = toStringList(
message,
`retry #${attempt + 1} in ${Math.floor(delay) / 1000}s`
)
logVerbose(msg)
trace?.resultItem(false, msg)
return delay
},
})
Expand Down

0 comments on commit a2a2ba2

Please sign in to comment.