const startDelay = 200
const maxDelay = 500
const retryPolicy = pipe(
Schedule.intersect(
Schedule.linear(startDelay).pipe(Schedule.modifyDelay(Duration.max(maxDelay))),
Schedule.recurs(5)
),
Schedule.whileInput(
(error: ParsedArangoError) =>
error._tag === 'LockTimeout' ||
error._tag === 'ConflictDetected' ||
error._tag === 'TransactionNotFound'
)
);
const startDelay = 200
const maxDelay = 500
const retryPolicy = pipe(
Schedule.intersect(
Schedule.linear(startDelay).pipe(Schedule.modifyDelay(Duration.max(maxDelay))),
Schedule.recurs(5)
),
Schedule.whileInput(
(error: ParsedArangoError) =>
error._tag === 'LockTimeout' ||
error._tag === 'ConflictDetected' ||
error._tag === 'TransactionNotFound'
)
);