Skip to content

Commit 996fe42

Browse files
committed
Make polling for Lambda status more resilient
1 parent f299135 commit 996fe42

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

Libraries/test/IntegrationTests.Helpers/LambdaHelper.cs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,21 @@ public async Task WaitTillNotPending(List<string> functions)
7272
{
7373
while (true)
7474
{
75-
var response = await _lambdaClient.GetFunctionConfigurationAsync(new GetFunctionConfigurationRequest { FunctionName = function });
76-
if (response.State == State.Pending)
75+
try
7776
{
78-
await Task.Delay(1000);
77+
var response = await _lambdaClient.GetFunctionConfigurationAsync(new GetFunctionConfigurationRequest { FunctionName = function });
78+
if (response.State == State.Pending)
79+
{
80+
await Task.Delay(1000);
81+
}
82+
else
83+
{
84+
break;
85+
}
7986
}
80-
else
87+
catch(TooManyRequestsException)
8188
{
82-
break;
89+
await Task.Delay(10000);
8390
}
8491
}
8592
}

0 commit comments

Comments
 (0)