Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Improve data sync network connectivity check Fix https://github.com/siyuan-note/siyuan/issues/9251

Daniel388ab0a35276
diff --git a/kernel/util/net.go b/kernel/util/net.go
index a07c7d9704..2fb5d2618a 100644
--- a/kernel/util/net.go
+++ b/kernel/util/net.go
@@ -55,6 +55,7 @@ func isOnline(checkURL string, skipTlsVerify bool) (ret bool) {
if skipTlsVerify {
c.EnableInsecureSkipVerify()
}
+ c.SetUserAgent(UserAgent)
for i := 0; i < 3; i++ {
resp, err := c.R().Get(checkURL)
@@ -66,6 +67,7 @@ func isOnline(checkURL string, skipTlsVerify bool) (ret bool) {
case *url.Error:
if err.(*url.Error).URL != checkURL {
// DNS 重定向
+ logging.LogWarnf("network is online [DNS redirect, checkURL=%s, retURL=%s]", checkURL, err.(*url.Error).URL)
return true
}
}
@@ -74,6 +76,9 @@ func isOnline(checkURL string, skipTlsVerify bool) (ret bool) {
if ret {
break
}
+
+ time.Sleep(1 * time.Second)
+ logging.LogWarnf("check url [%s] is online failed: %s", checkURL, err)
}
return
}