Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions core/deadline.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,16 +176,10 @@ func (d *deadliner) run(ctx context.Context, deadlineFunc DeadlineFunc) {
setCurrState()
}
case <-currTimer.Chan():
// Send deadlined duty to receiver.
select {
case <-ctx.Done():
return
case d.deadlineChan <- currDuty:
default:
log.Warn(ctx, "Deadliner output channel full", nil,
z.Str("label", d.label),
z.Any("duty", currDuty),
)
}

delete(duties, currDuty)
Expand Down Expand Up @@ -217,7 +211,7 @@ func (d *deadliner) C() <-chan Duty {
return d.deadlineChan
}

// getCurrDuty gets the duty to process next along-with the duty deadline. It selects duty with the latest deadline.
// getCurrDuty gets the duty to process next along with the duty deadline. It selects duty with the earliest deadline.
func getCurrDuty(duties map[Duty]bool, deadlineFunc DeadlineFunc) (Duty, time.Time) {
var currDuty Duty

Expand Down