Fixing 5x loop when warming up
This commit is contained in:
parent
64c4354e5e
commit
0e4c7ca0f1
1 changed files with 3 additions and 0 deletions
|
|
@ -721,6 +721,7 @@ export class BaanReserverenService {
|
|||
const classList = Object.values(classListObj)
|
||||
const rClass = classList.filter((cl) => /r-\d{2}/.test(cl))[0]
|
||||
const courtNumber =
|
||||
// @ts-expect-error just in case
|
||||
`${CourtSlotToNumber[rClass.replace(/r-/, '') as CourtSlot]}` ??
|
||||
'unknown court'
|
||||
const startTime = await court
|
||||
|
|
@ -912,8 +913,10 @@ export class BaanReserverenService {
|
|||
try {
|
||||
currentAttempt++
|
||||
await this.init()
|
||||
break
|
||||
} catch (err: unknown) {
|
||||
if (err instanceof RunningReservationsNavigationError) {
|
||||
this.loggerService.warn('Hit expected warmup error, retrying', { currentAttempt })
|
||||
await new Promise((res) => setTimeout(res, delay))
|
||||
} else {
|
||||
throw err
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue