fix: show meaningful update runs and tidy update access layout
This commit is contained in:
1 parent
81def77e3c
commit
bef669f3d9
12 files changed
+85
-20
No files matched your search
+18
-1
@@ -1480,7 +1480,24 @@ func (s *Store) RecoverInterruptedRuns(ctx context.Context) error {
|
||||
}
|
||||
|
||||
func (s *Store) RecentRuns(ctx context.Context, limit int) ([]model.UpdateRun, error) {
|
||||
rows, err := s.db.QueryContext(ctx, `SELECT id, started_at, finished_at, status, ipv4, ipv6, summary FROM update_runs ORDER BY id DESC LIMIT ?`, limit)
|
||||
return s.recentRuns(ctx, limit, false)
|
||||
}
|
||||
|
||||
// RecentSignificantRuns keeps changes and failures visible even after many
|
||||
// successful checks without changes. The existing history stores counts only
|
||||
// in its summary, so exclude the scheduler's two known successful no-op results.
|
||||
// Unknown summaries and all failures are retained rather than silently hidden.
|
||||
func (s *Store) RecentSignificantRuns(ctx context.Context, limit int) ([]model.UpdateRun, error) {
|
||||
return s.recentRuns(ctx, limit, true)
|
||||
}
|
||||
|
||||
func (s *Store) recentRuns(ctx context.Context, limit int, significantOnly bool) ([]model.UpdateRun, error) {
|
||||
query := `SELECT id, started_at, finished_at, status, ipv4, ipv6, summary FROM update_runs`
|
||||
if significantOnly {
|
||||
query += ` WHERE status IN ('error', 'partial') OR (status = 'ok' AND summary NOT IN ('0 Ziel(e) aktualisiert, 0 Fehler', 'Keine aktiven DynDNS-Ziele'))`
|
||||
}
|
||||
query += ` ORDER BY id DESC LIMIT ?`
|
||||
rows, err := s.db.QueryContext(ctx, query, limit)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user