From e6a1e733b04d08ee882033c1f4ed58b93143151e Mon Sep 17 00:00:00 2001 From: Robin Tang Date: Thu, 27 Jun 2024 01:08:06 -0700 Subject: [PATCH] Static sleep. --- sources/dynamodb/shard.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sources/dynamodb/shard.go b/sources/dynamodb/shard.go index 0f7a2010..3b33d62c 100644 --- a/sources/dynamodb/shard.go +++ b/sources/dynamodb/shard.go @@ -30,10 +30,9 @@ func (s *StreamStore) processShard(ctx context.Context, shard *dynamodbstreams.S if shard.ParentShardId != nil { parentID := *shard.ParentShardId - if !s.storage.GetShardProcessed(parentID) && s.storage.GetShardProcessing(parentID) { - slog.Info("Parent shard is being processed, let's sleep and retry", slog.String("shardId", *shard.ShardId)) - - time.Sleep(jitter.Jitter(500, jitter.DefaultMaxMs, 0)) + if s.storage.GetShardProcessing(parentID) && !s.storage.GetShardProcessed(parentID) { + slog.Info("Parent shard is being processed, let's sleep 3s and retry", slog.String("shardId", *shard.ShardId)) + time.Sleep(3 * time.Second) s.processShard(ctx, shard, writer) return }