feat(11-02): run plugin schedules as River periodic jobs through bonfire.Call

- pact.HasSchedule with ScheduledCommand and Daily/DailyAt/Every cadences (no River import)
- bonfire.Call, Catalog and ErrUnknownCommand for in-process command runs
- conga Daily/Every wall-clock schedules in app.timezone, periodic jobs on every worker,
  scheduled queue (MaxAttempts 1, unique by args within the cadence period)
- scheduled worker runs only entries matching the compiled table; unregistered
  commands are skipped with a Warn log
- generated app main publishes bonfire.NewCatalog(commands); hello main regenerated
This commit is contained in:
Jakub Zych
2026-09-29 19:47:51 +02:00
parent 77b8ff177a
commit d9f939a1ea
15 changed files with 890 additions and 12 deletions

View File

@@ -45,6 +45,11 @@ type Manager struct {
jobs map[string]congaJob
inserter *river.Client[*sql.Tx]
worker *river.Client[*sql.Tx]
// scheduledJob is the built-in scheduled command job; schedule is the
// compiled entry table of the running worker, keyed by entry id.
scheduledJob pact.Job
schedule map[string]pact.ScheduledCommand
}
// From returns the app's Manager, publishing a new one on first use.