Skip to content

Commit

Permalink
dynamodb: Add extra check for wait
Browse files Browse the repository at this point in the history
  • Loading branch information
YakDriver committed Sep 13, 2024
1 parent 3956e85 commit ec4203d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions internal/service/dynamodb/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,12 @@ func waitTTLUpdated(ctx context.Context, conn *dynamodb.Client, tableName string

func waitSSEUpdated(ctx context.Context, conn *dynamodb.Client, tableName string, timeout time.Duration) (*awstypes.TableDescription, error) { //nolint:unparam

Check failure on line 207 in internal/service/dynamodb/wait.go

View workflow job for this annotation

GitHub Actions / 3 of 3

directive `//nolint:unparam` is unused for linter "unparam" (nolintlint)
stateConf := &retry.StateChangeConf{
Pending: enum.Slice(awstypes.SSEStatusDisabling, awstypes.SSEStatusEnabling, awstypes.SSEStatusUpdating),
Target: enum.Slice(awstypes.SSEStatusDisabled, awstypes.SSEStatusEnabled),
Refresh: statusSSE(ctx, conn, tableName),
Timeout: max(updateTableTimeout, timeout),
Delay: 30 * time.Second,
Pending: enum.Slice(awstypes.SSEStatusDisabling, awstypes.SSEStatusEnabling, awstypes.SSEStatusUpdating),
Target: enum.Slice(awstypes.SSEStatusDisabled, awstypes.SSEStatusEnabled),
Refresh: statusSSE(ctx, conn, tableName),
Timeout: max(updateTableTimeout, timeout),
ContinuousTargetOccurence: 2,
Delay: 30 * time.Second,
}

outputRaw, err := stateConf.WaitForStateContext(ctx)
Expand All @@ -229,8 +230,9 @@ func waitReplicaSSEUpdated(ctx context.Context, conn *dynamodb.Client, region, t
Refresh: statusSSE(ctx, conn, tableName, func(o *dynamodb.Options) {
o.Region = region
}),
Timeout: max(updateTableTimeout, timeout),
Delay: 30 * time.Second,
Timeout: max(updateTableTimeout, timeout),
ContinuousTargetOccurence: 2,
Delay: 30 * time.Second,
}

outputRaw, err := stateConf.WaitForStateContext(ctx)
Expand Down

0 comments on commit ec4203d

Please sign in to comment.