Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add retry for admin client sign in for test #5767

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -620,9 +620,18 @@ async fn get_admin_client(client: &Arc<AFCloudClient>) -> FlowyResult<Client> {
ClientConfiguration::default(),
&client.client_version.to_string(),
);
admin_client
// When multiple admin_client instances attempt to sign in concurrently, multiple admin user
// creation transaction will be created, but only the first attempt will succeed due to the
// unique email constraint. Once the user has been created, admin_client instances can sign in
// concurrently without issue.
let resp = admin_client
.sign_in_password(&admin_email, &admin_password)
.await?;
.await;
if resp.is_err() {
admin_client
.sign_in_password(&admin_email, &admin_password)
.await?;
};
Ok(admin_client)
}

Expand Down
Loading