Logging Current Error with Duration and Attempt in a Scheduler

Is it possible to log the current error along with duration and attempt in a Scheduler?

Schedule.onDecision(([duration, attempt], decision) =>
  decision._tag === "Continue"
    ? Effect.logInfo(
        `Retrying TokenSet persistence in ${Duration.format(duration)} (attempt #${++attempt})`
      )
    : Effect.void
)


do I have to do some wild gymnastics with Schedule.identity?
Was this page helpful?