88
func (m *taskKeyManager) getExclusiveReaderHighWatermark(
89
category tasks.Category,
91
>
minTaskKey, ok := m.tracker.minTaskKey(category)
92
>
if !ok {
93
minTaskKey = tasks.MaximumKey
94
}
95
96
// TODO: should this be moved generator.setTaskKeys() ?
98
>
// TODO: Truncation here is just to make sure task scheduled time has the same precision as the old logic.
99
>
// Remove this truncation once we validate the rest of the code can worker correctly with higher precision.
100
>
m.timeSource.Now().Add(m.config.TimerProcessorMaxTimeShift()).Truncate(common.ScheduledTaskMinPrecision),
101
>
)
102
>
103
>
nextTaskKey := m.generator.peekTaskKey(category)
104
>
105
>
exclusiveReaderHighWatermark := tasks.MinKey(
106
>
minTaskKey,
107
>
nextTaskKey,
108
>
)
109
>
if category.Type() == tasks.CategoryTypeScheduled {
110
exclusiveReaderHighWatermark.TaskID = 0
111