mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-09-11 11:15:53 +03:00
fix: Add retry for admin client sign in for test (#5767)
This commit is contained in:
parent
d5544af6c5
commit
e426970eed
@ -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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user