From 5495a73aa092924c7e1552d90e12b187630b035e Mon Sep 17 00:00:00 2001 From: Mengran Lan Date: Fri, 23 Aug 2024 00:23:55 +0800 Subject: [PATCH] filter the case when sentry endpoint is empty string --- coordinator/internal/types/auth.go | 2 +- prover/src/coordinator_client.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/coordinator/internal/types/auth.go b/coordinator/internal/types/auth.go index 9e7e0fb99..6bbe2080f 100644 --- a/coordinator/internal/types/auth.go +++ b/coordinator/internal/types/auth.go @@ -24,7 +24,7 @@ const ( type LoginSchema struct { Time time.Time `json:"time"` Token string `json:"token"` - SentryEndpoint string `json:"sentry_endpoint"` + SentryEndpoint string `json:"sentry_endpoint,omitempty"` } // TODO just use for darwin upgrade, need delete next upgrade diff --git a/prover/src/coordinator_client.rs b/prover/src/coordinator_client.rs index 366daf316..86e26c4e7 100644 --- a/prover/src/coordinator_client.rs +++ b/prover/src/coordinator_client.rs @@ -92,7 +92,7 @@ impl<'a> CoordinatorClient<'a> { } if let Some(r) = login_response.data { token = r.token; - let _ = self.sentry_endpoint.set(r.sentry_endpoint); + let _ = self.sentry_endpoint.set(r.sentry_endpoint.filter(|s| !s.is_empty())); } else { bail!("login failed: got empty token") }