2160
}
2161
2163
>
// We need to set lastUpdate time to "now" - "wait between shard updates time" + "first update interval".
2164
>
// This is done to make sure that first shard update` will happen around "first update interval" after "now".
2165
>
// The idea is to allow queue to persist even in the case of (relativly) constantly
2166
>
// moving shards between hosts.
2167
>
// Note: it still may prevent queue from progressing if shard moving rate is too high
2168
>
lastUpdated := s.timeSource.Now()
2169
>
lastUpdated = lastUpdated.Add(-1 * s.config.ShardUpdateMinInterval())
2170
>
lastUpdated = lastUpdated.Add(s.config.ShardFirstUpdateInterval())
2171
>
s.lastUpdated = lastUpdated
2172
>
}
2173
2174
// TODO: why do we need a deep copy here?