114
}
115
117
>
118
>
// lastAction is used to set the high water mark for future ProcessTimeRange
119
>
// invocations. The code below will set a "last action" even when none is taken,
120
>
// simply to indicate that processing can permanently skip that period of time
121
>
// (e.g., it was prior to an update or past a catchup).
122
>
lastAction := end
123
>
124
>
var next legacyscheduler.GetNextTimeResult
125
>
var err error
126
>
var bufferedStarts []*schedulespb.BufferedStart
127
>
var droppedCount int64
128
>
recordedGenerateLatency := false
129
>
// Once the buffer fills, drop further automated actions (counted in
130
>
// droppedCount) instead of buffering. A non-manual limit already <= 0 means
131
>
// the buffer was full on entry, so the whole range drops. Manual (backfill)
132
>
// callers pass a positive limit and break to retry the remainder, never drop.
133
>
limitReached := limit != nil && !manual && *limit <= 0
134
>
computeLimitWarning := false
135
>
for next, err = s.NextTime(scheduler, start); err == nil && (!next.Next.IsZero() && !next.Next.After(end)); next, err = s.NextTime(scheduler, next.Next) {
136
computeLimitWarning = computeLimitWarning || next.ComputeLimitWarning
137
lastAction = next.Next