Skip to content

Commit

Permalink
Fix slice pending task count (#3676)
Browse files Browse the repository at this point in the history
  • Loading branch information
yycptt committed Nov 30, 2022
1 parent f389611 commit f6a340d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion service/history/queues/slice.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,9 @@ func (s *SliceImpl) SelectTasks(readerID int32, batchSize int) ([]Executable, er
return []Executable{}, nil
}

defer s.monitor.SetSlicePendingTaskCount(s, len(s.executableTracker.pendingExecutables))
defer func() {
s.monitor.SetSlicePendingTaskCount(s, len(s.executableTracker.pendingExecutables))
}()

executables := make([]Executable, 0, batchSize)
for len(executables) < batchSize && len(s.iterators) != 0 {
Expand Down

0 comments on commit f6a340d

Please sign in to comment.