Skip to content

Commit

Permalink
fix(plugin-server): only do 2 retries, for a total of 3 tries
Browse files Browse the repository at this point in the history
  • Loading branch information
bretthoerner committed Oct 19, 2023
1 parent e968091 commit c68167a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion plugin-server/src/utils/retries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export async function runRetriableFunction(retriableFunctionPayload: RetriableFu
/**
* Retry a function, respecting `error.isRetriable`.
*/
export async function retryIfRetriable<T>(fn: () => Promise<T>, retries = 3, sleepMs = 500): Promise<T> {
export async function retryIfRetriable<T>(fn: () => Promise<T>, retries = 2, sleepMs = 500): Promise<T> {
for (let i = 0; i < retries; i++) {
try {
return await fn()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,6 @@ describe('eachBatchX', () => {
runEventPipelineSpy
.mockImplementationOnce(() => Promise.reject('runEventPipeline nopes out'))
.mockImplementationOnce(() => Promise.reject('runEventPipeline nopes out'))
.mockImplementationOnce(() => Promise.reject('runEventPipeline nopes out'))
await expect(eachBatchParallelIngestion(batch, queue, IngestionOverflowMode.Disabled)).rejects.toBe(
'runEventPipeline nopes out'
)
Expand Down

0 comments on commit c68167a

Please sign in to comment.