Skip to content

Commit

Permalink
fix: task count increment bug in scheduler.go
Browse files Browse the repository at this point in the history
  • Loading branch information
WangYihang committed Mar 28, 2024
1 parent 28a2b73 commit f3e423c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,13 @@ func (s *Scheduler) Worker() {
data, err := json.Marshal(task)
if err != nil {
slog.Error("error occured while serializing task", slog.String("error", err.Error()))
s.FailedTaskCount.Add(1)
} else {
s.logWg.Add(1)
s.LogChan <- string(data)
}
if task.Error != "" {
s.FailedTaskCount.Add(1)
} else {
s.SucceedTaskCount.Add(1)
}
// Notify task is done
Expand Down

0 comments on commit f3e423c

Please sign in to comment.