Chat autosend, week rollover and ai_runs purge schedules (Feature 20)
shopping_chat_autosend fires at chat_autosend_dow/time for the coming
week and posts its Supply run through SendToChat when a webhook is
stored, list_ready's Chat channel is on and the list exists unsent;
otherwise it logs why (key list_ready:chat:{weekStart}). week_rollover
freezes the previous week at Monday 00:05 through Freeze, judging the
week ended by the fire time. ai_runs_purge calls harness.Purge daily at
03:00 with the fire time less RunRetention. Fake-clock tests cover each.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -204,6 +204,19 @@ func run(cfg config.Config, logger *slog.Logger) error {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err := sched.Register(shopSvc.ChatAutosendSchedule()); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := sched.Register(shopSvc.RolloverSchedule()); err != nil {
|
||||
return err
|
||||
}
|
||||
purge, err := harness.PurgeSchedule(db, logger)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := sched.Register(purge); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
router, err := server.NewRouter(logger, version, cfg.TrustedProxy, authFlow, sessions, settings, search, ai, chatSvc, dinnerSvc, suggestSvc, planSvc, shopSvc, googleSvc, pushSvc, ideasSvc, runner, photos, frontend.Assets())
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user