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:
@@ -5612,11 +5612,19 @@ func (a *App) recomputeAwardRefsForCodesAsync(codes []string) {
|
||||
// definition / reference-list change, or a bulk ADIF import.
|
||||
func (a *App) recomputeAwardRefsAsync() {
|
||||
go func() {
|
||||
t0 := time.Now()
|
||||
n, err := a.RecomputeAllAwardRefs()
|
||||
if err != nil {
|
||||
applog.Printf("award_refs: bulk recompute failed: %v", err)
|
||||
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 {
|
||||
wruntime.EventsEmit(a.ctx, "awards:recomputed", n)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user