Fix goal recovery

This commit is contained in:
ms2k 2026-10-22 22:05:33 +09:00
commit 996f586bc1

View file

@ -40,6 +40,16 @@ func openStore(path string) (*store, error) {
if err != nil {
return nil, errors.Join(err, s.close())
}
for _, w := range s.Watches {
if w.Known && w.Goal != nil && w.Goal.Status.waiting() && w.Turn.Status == "failed" {
if w.Hold != nil && w.Goal.Status == "usageLimited" && w.Hold.Status == "usageLimited" {
w.Hold = nil
}
if w.Hold == nil {
w.Armed = true
}
}
}
return s, nil
}