We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d5cf7e2 commit 800e3ccCopy full SHA for 800e3cc
internal/cms/task_processor.go
@@ -476,12 +476,8 @@ func (p *TaskProcessor) initLastNodeBanTime(tasks []*models.Task) {
476
477
// initLastTaskProcessingTime initializes last task processing time.
478
func (p *TaskProcessor) initLastTaskProcessingTime(tasks []*models.Task) {
479
- if !p.lastTaskProcessingTime.IsZero() {
480
- return
481
- }
482
-
483
- if len(tasks) == 0 {
484
- p.lastTaskProcessingTime = time.Now()
+ if !p.lastTaskProcessingTime.IsZero() || len(tasks) == 0 {
+ // Keeping zero time if len(tasks) == 0 because otherwise p.reset(nil) will break metric' logic.
485
return
486
}
487
0 commit comments