Skip to content

Commit

Permalink
fix: ignore errors while waiting for stamp (#927)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cafe137 authored Jun 18, 2024
1 parent 7515b57 commit ac2092e
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/bee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1810,21 +1810,15 @@ export class Bee {
}

private async waitForUsablePostageStamp(id: BatchId, timeout = 240_000): Promise<void> {
const TIME_STEP = 2_000
const TIME_STEP = 3_000
for (let time = 0; time < timeout; time += TIME_STEP) {
try {
const stamp = await this.getPostageBatch(id)

if (stamp.usable) {
return
}
} catch (error: any) {
const message = error?.response?.data?.message || error?.message || ''

if (!message.includes('batch not usable')) {
throw error
}
}
} catch (error: any) {}

Check warning on line 1821 in src/bee.ts

View workflow job for this annotation

GitHub Actions / check (16.x)

Unexpected any. Specify a different type

Check warning on line 1821 in src/bee.ts

View workflow job for this annotation

GitHub Actions / check (16.x)

Empty block statement

await System.sleepMillis(TIME_STEP)
}
Expand Down

0 comments on commit ac2092e

Please sign in to comment.