Skip to content

Commit

Permalink
Web: Prevent updating with in-progress status
Browse files Browse the repository at this point in the history
  • Loading branch information
Kashkovsky committed Apr 15, 2022
1 parent 4aaab6d commit 687621b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion web/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,14 @@ func (s *Server) serveWs(w http.ResponseWriter, r *http.Request) {
func (s *Server) startWatch() {
watcher := core.NewWatcher(s.config)
go watcher.Watch(func(res core.TestResult) {
s.results.Store(res.Id, res)
if res.InProgress {
_, ok := s.results.Load(res.Id)
if !ok {
s.results.Store(res.Id, res)
}
} else {
s.results.Store(res.Id, res)
}
})
}

Expand Down

0 comments on commit 687621b

Please sign in to comment.