const connect_socket_with_retry = connect_socket_Effect
.pipe(
Effect.retry({
schedule: Schedule.intersect(
Schedule.recurUpTo('30 seconds'),
Schedule.exponential('20 millis').pipe(Schedule.jittered)
)
.pipe(
Schedule.andThen(
Schedule.intersect(
Schedule.recurUpTo('10 minutes'),
Schedule.spaced('10 seconds').pipe(Schedule.jittered)
)
)
)
.pipe(
Schedule.andThen(
Schedule.intersect(
Schedule.recurUpTo('6 hours'),
Schedule.spaced('30 seconds').pipe(Schedule.jittered)
)
)
),
})
)
.pipe(Effect.tapError(() => Effect.log(`Connection retries exhausted. No longer will retry.`)));
const connect_socket_with_retry = connect_socket_Effect
.pipe(
Effect.retry({
schedule: Schedule.intersect(
Schedule.recurUpTo('30 seconds'),
Schedule.exponential('20 millis').pipe(Schedule.jittered)
)
.pipe(
Schedule.andThen(
Schedule.intersect(
Schedule.recurUpTo('10 minutes'),
Schedule.spaced('10 seconds').pipe(Schedule.jittered)
)
)
)
.pipe(
Schedule.andThen(
Schedule.intersect(
Schedule.recurUpTo('6 hours'),
Schedule.spaced('30 seconds').pipe(Schedule.jittered)
)
)
),
})
)
.pipe(Effect.tapError(() => Effect.log(`Connection retries exhausted. No longer will retry.`)));