Skip to content

Commit

Permalink
Fix issue unexpected exit when auth polling
Browse files Browse the repository at this point in the history
  • Loading branch information
ktiays authored and unixzii committed Jul 7, 2023
1 parent c9b5bf2 commit 1d9a68d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions crates/cursor-core/src/auth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,15 @@ async fn polling(
HttpMethod::Get,
)
.send()
.await else {
// If the request fails, it means that the server is not ready yet,
// so we need to continue polling.
.await
else {
continue;
};
if response.status_code() != 200 {
// If the request fails, it means that the server is not ready yet,
// so we need to continue polling.
continue;
}
let data = response.text().await;

#[cfg(debug_assertions)]
Expand Down

0 comments on commit 1d9a68d

Please sign in to comment.