Skip to content

Commit 7474b54

Browse files
tcl00tacocsmarchbanks
authored andcommitted
Doing an initial synch and then sleep to space out subsequent cycles. #1618 (#1900)
Signed-off-by: Samiur Arif <[email protected]>
1 parent d1529ff commit 7474b54

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/chunk/table_manager.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,6 @@ func (m *TableManager) Stop() {
167167
func (m *TableManager) loop() {
168168
defer m.wait.Done()
169169

170-
// Sleep for a bit to spread the sync load across different times if the tablemanagers are all started at once.
171-
time.Sleep(time.Duration(rand.Int63n(int64(m.cfg.DynamoDBPollInterval))))
172-
173170
ticker := time.NewTicker(m.cfg.DynamoDBPollInterval)
174171
defer ticker.Stop()
175172

@@ -179,6 +176,9 @@ func (m *TableManager) loop() {
179176
level.Error(util.Logger).Log("msg", "error syncing tables", "err", err)
180177
}
181178

179+
// Sleep for a bit to spread the sync load across different times if the tablemanagers are all started at once.
180+
time.Sleep(time.Duration(rand.Int63n(int64(m.cfg.DynamoDBPollInterval))))
181+
182182
for {
183183
select {
184184
case <-ticker.C:

0 commit comments

Comments
 (0)