SuperPi.Workers.ScheduleRunWorker (super_pi v0.1.0)

Copy Markdown View Source

Starts one fire of a schedule. Unique on [:schedule_id, :fire_at] forever (period: :infinity), where fire_at is the scheduled minute (or a webhook's Idempotency-Key), so a duplicate tick or a webhook retry inserts nothing. SuperPi.Schedule.run/2 then claims the fire with a conditional update, which makes an Oban retry or a Lifeline rescue harmless.

The job ends when the run task is stored and its conversation machine is told. It does not wait for the turn, so it never holds a queue slot for the length of an LLM run. After the last attempt a failure counts against the schedule like a failed run.