0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-27 22:19:04 -05:00

remove token wait time (#10477)

This commit is contained in:
Fred K. Schott 2024-03-18 20:45:47 -07:00 committed by GitHub
parent 0ddc327ee8
commit 124cdd64f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View file

@ -0,0 +1,5 @@
---
"@astrojs/db": patch
---
Remove redundant wait time on token creation

View file

@ -62,10 +62,6 @@ class ManagedRemoteAppToken implements ManagedAppToken {
throw new Error(`Failed to create token: ${res.status} ${res.statusText}`);
}
);
// Wait for 2 seconds! This is the maximum time we would reasonably expect a token
// to be created and propagate to all the necessary DB services. Without this, you
// risk a token being created, used immediately, and failing to authenticate.
await new Promise((resolve) => setTimeout(resolve, 2000));
spinner.succeed(green('Connected to remote database.'));
const { token, ttl } = await response.json();