Fail the batch job when recording its end fails, and reconcile orphans
finishBatch now returns its error, and treats a batch that is no longer running as one, so a batch job never ends succeeded with its batch still running. A batch left pending or running with its job ended (process stopped, or the final status write failed) is failed inside startBatch, before the active batch is read, so it never blocks a manual or replenish batch. This replaces the boot-only FailInterruptedBatches. Document suggestions.name in the architecture schema summary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -150,11 +150,6 @@ func run(cfg config.Config, logger *slog.Logger) error {
|
||||
if _, err := dinnerSvc.FailInterruptedGroundings(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
// Likewise a suggestion batch with no job left to run it, so it does
|
||||
// not block every later batch.
|
||||
if _, err := suggestSvc.FailInterruptedBatches(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
srv := &http.Server{
|
||||
Addr: cfg.HTTPAddr,
|
||||
Handler: router,
|
||||
|
||||
Reference in New Issue
Block a user