feat(conga,dev): worker and scheduler reports, summer dev runs serve

- queue:work and schedule:run print a startup summary and a shutdown
  report on a terminal, log them as records otherwise, and return nil
  after a clean stop
- schedule:run --once ends with 'Ran N due entries (M failed)'
- summer dev runs bin/<app> serve with the forwarded global options,
  reports through Output, stops the old server before starting the new
  one and prints a dev report on Ctrl+C (exit 0)
- lagoon.DatabaseLabel describes a DSN without its secrets
- Long help and examples for queue:work, schedule:run, dev, docs:serve
This commit is contained in:
Jakub Zych
2026-10-21 13:04:27 +02:00
parent c38dc1fe48
commit 168d65cd1b
15 changed files with 319 additions and 81 deletions

View File

@@ -40,6 +40,8 @@ type Worker struct {
listener *pgxpool.Pool
queues []string
counters *workerCounters
// concurrency is each queue's MaxWorkers, for the startup summary.
concurrency map[string]int
}
// WorkerStats counts the job attempts a worker ran since it started.
@@ -195,7 +197,7 @@ func StartWorker(ctx context.Context, app *backpack.App, plugins []party.Plugin,
m.worker = client
m.schedule = table
m.counters.Store(counters)
return &Worker{m: m, client: client, listener: listener, queues: sortedQueueNames(queues), counters: counters}, nil
return &Worker{m: m, client: client, listener: listener, queues: sortedQueueNames(queues), counters: counters, concurrency: queues}, nil
}
// StartServeWorker starts the in-process worker of the serve command on