Skip to content

Commit

Permalink
remove token wait time (#10477)
Browse files Browse the repository at this point in the history
  • Loading branch information
FredKSchott authored Mar 19, 2024
1 parent 0ddc327 commit 124cdd6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/small-crabs-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@astrojs/db": patch
---

Remove redundant wait time on token creation
4 changes: 0 additions & 4 deletions packages/db/src/core/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 124cdd6

Please sign in to comment.