From bc2a57e05e163956f6af58f1a31d34e18e2a50f8 Mon Sep 17 00:00:00 2001 From: zhongchao Date: Tue, 18 Apr 2023 16:43:12 +0800 Subject: [PATCH] [3.1.0]reject the stop and restart of socket --- .../eagle/core/function/startup/stageone/HttpDnsStartUp.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/HttpDnsStartUp.kt b/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/HttpDnsStartUp.kt index c25751ba4a..28531f8a3b 100644 --- a/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/HttpDnsStartUp.kt +++ b/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/HttpDnsStartUp.kt @@ -52,10 +52,11 @@ class HttpDnsStartUp : AndroidStartup() { private var context: Context? = null + @Volatile private var gotToken = false private var httpDnsSimpleLocation by Delegates.observable(getDefaultSimpleLocation()) { _, oldValue, newValue -> - if (oldValue.cityCode != newValue.cityCode) { + if (gotToken && oldValue.cityCode != newValue.cityCode) { reConnectSocket(oldValue.cityCode, newValue.cityCode) } }