chore: cleanup sprint — dead CSS, dedup helpers, handler refactor
Remove ~126 lines of orphaned CSS from tile slim-down and old detail layout. Consolidate 4 duplicate duration formatters into shared elapsed()/fmtElapsed() helpers. Break 160-line Result handler into focused sub-functions. Implement real Hub.Shutdown() (was a no-op). Standardize agent error responses to JSON. Replace panic() in router init with error return. Extract magic numbers as named constants. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,10 @@ import (
|
||||
// doesn't block dispatch. Used by the StartRun preflight and the
|
||||
// dispatcher itself — both must agree or the operator's click-time
|
||||
// validation wouldn't match the dispatch-time check.
|
||||
const HostHeartbeatStaleAfter = 60 * time.Second
|
||||
const (
|
||||
HostHeartbeatStaleAfter = 60 * time.Second
|
||||
dispatchTickInterval = 2 * time.Second
|
||||
)
|
||||
|
||||
// Dispatcher picks Queued runs off the DB and drives them to
|
||||
// WaitingReboot — the happy path is heartbeat-first: we transition and
|
||||
@@ -76,7 +79,7 @@ func (d *Dispatcher) Stop() {
|
||||
}
|
||||
|
||||
func (d *Dispatcher) loop(ctx context.Context) {
|
||||
t := time.NewTicker(2 * time.Second)
|
||||
t := time.NewTicker(dispatchTickInterval)
|
||||
defer t.Stop()
|
||||
for {
|
||||
select {
|
||||
|
||||
Reference in New Issue
Block a user