chore(awards): log a successful bulk recompute, not only a failed one

"I changed an award and the column stayed empty" cannot be answered
without knowing whether the recompute ran at all, how long it took, and
whether it changed anything — and zero rows changed is a real answer
(the definition matches nothing in the log) that looks exactly like a
recompute which never happened.
This commit is contained in:
2026-09-08 00:19:12 +02:00
parent 1cbf3ecc4b
commit 2414b2077f
+8
View File
@@ -5612,11 +5612,19 @@ func (a *App) recomputeAwardRefsForCodesAsync(codes []string) {
// definition / reference-list change, or a bulk ADIF import. // definition / reference-list change, or a bulk ADIF import.
func (a *App) recomputeAwardRefsAsync() { func (a *App) recomputeAwardRefsAsync() {
go func() { go func() {
t0 := time.Now()
n, err := a.RecomputeAllAwardRefs() n, err := a.RecomputeAllAwardRefs()
if err != nil { if err != nil {
applog.Printf("award_refs: bulk recompute failed: %v", err) applog.Printf("award_refs: bulk recompute failed: %v", err)
return return
} }
// Logged on SUCCESS too, and this is why: "I changed an award and the
// column stayed empty" is unanswerable without knowing whether the
// recompute ran at all, how long it took, and whether it changed
// anything. Zero rows changed is a real answer — the definition matches
// nothing in the log — and it looks exactly like a recompute that never
// happened.
applog.Printf("award_refs: bulk recompute done — %d rows changed in %s", n, time.Since(t0).Round(time.Millisecond))
if a.ctx != nil { if a.ctx != nil {
wruntime.EventsEmit(a.ctx, "awards:recomputed", n) wruntime.EventsEmit(a.ctx, "awards:recomputed", n)
} }