Fix :编辑按钮保留历史记录

This commit is contained in:
XOF
2025-11-30 13:32:29 +08:00
parent 3b5842842e
commit d1ae8268f9

10
main.go
View File

@@ -427,6 +427,16 @@ func handleTask(w http.ResponseWriter, r *http.Request) {
Time: now.Add(time.Duration(i-90) * time.Minute), Time: now.Add(time.Duration(i-90) * time.Minute),
} }
} }
} else {
mu.RLock()
if existing, ok := tasks[task.ID]; ok {
task.History = existing.History
task.InStock = existing.InStock
task.LastCheck = existing.LastCheck
task.Status = existing.Status
task.Notified = existing.Notified
}
mu.RUnlock()
} }
mu.Lock() mu.Lock()