Skip to content

Commit

Permalink
better retry logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Annonator committed Jan 5, 2024
1 parent d4a5649 commit 039ba93
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/PlayFabBuddy.Cli/Commands/Player/CreateNewPlayersCommand.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using PlayFabBuddy.Infrastructure.Adapter.PlayFab;
using PlayFabBuddy.Infrastructure.Exceptions;
using PlayFabBuddy.Infrastructure.Exceptions;
using PlayFabBuddy.Lib.Interfaces.Adapter;
using PlayFabBuddy.Lib.UseCases.Player;
using Spectre.Console;
Expand Down Expand Up @@ -46,10 +45,12 @@ private async Task CreateUsers(int numberOfUsersToCreate, ProgressTask task)
if (e.RetryInSeconds is not null)
{
retry = (int)e.RetryInSeconds;
}
}

Thread.Sleep(1000 * retry);

await new RegisterNewPlayerUseCase(playerAccountAdapter).ExecuteAsync();

// We need to decrement the counter because we didn't actually create a user and need to retry
i--;
}
}
}
Expand Down

0 comments on commit 039ba93

Please sign in to comment.