Skip to content
Playground(another site)

bynk.cron.bad_params

Error A cron handler declares more than one parameter, or a non-Instant one.

A scheduled trigger carries one thing, the time it fired, so an on schedule handler takes at most one parameter, and it must be an Instant: the time the schedule fired. Drop the parameter, or type it Instant. A parameter typed Int (the old spelling) is this error too: write at: Instant, and use at.toEpochMillis() where the body needs the number.

Example

on schedule("*/5 * * * *") (at: Int) -> Effect[Result[(), String]] { … } // ✗ the time is an `Instant`
on schedule("*/5 * * * *") (at: Instant) -> Effect[Result[(), String]] { … } // ✓

In the Book

See also

  • The grammar rule it governs: cron_handler.
  • Every code in its category, Cron, on the diagnostic index.
  • bynk explain bynk.cron.bad_params shows the same from the installed toolchain, without a network.