mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-17 09:30:48 +08:00
🎨 Use Endpoint
for network connectivity checks when syncing with third-party cloud providers https://github.com/siyuan-note/siyuan/issues/7805
This commit is contained in:
parent
e524f21622
commit
d5b5c082fb
@ -567,18 +567,19 @@ func planSyncAfter(d time.Duration) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func isProviderOnline() (ret bool) {
|
func isProviderOnline() (ret bool) {
|
||||||
|
checkURL := util.SiYuanSyncServer
|
||||||
switch Conf.Sync.Provider {
|
switch Conf.Sync.Provider {
|
||||||
case conf.ProviderSiYuan:
|
case conf.ProviderSiYuan:
|
||||||
ret = util.IsOnline(util.SiYuanSyncServer)
|
|
||||||
case conf.ProviderS3:
|
case conf.ProviderS3:
|
||||||
ret = util.IsOnline(Conf.Sync.S3.Endpoint)
|
checkURL = Conf.Sync.S3.Endpoint
|
||||||
case conf.ProviderWebDAV:
|
case conf.ProviderWebDAV:
|
||||||
ret = util.IsOnline(Conf.Sync.WebDAV.Endpoint)
|
checkURL = Conf.Sync.WebDAV.Endpoint
|
||||||
default:
|
default:
|
||||||
ret = util.IsOnline("")
|
logging.LogWarnf("unknown provider: %d", Conf.Sync.Provider)
|
||||||
|
util.IsOnline("")
|
||||||
}
|
}
|
||||||
|
|
||||||
if !ret {
|
if ret = util.IsOnline(checkURL); !ret {
|
||||||
util.PushErrMsg(Conf.Language(76), 5000)
|
util.PushErrMsg(Conf.Language(76), 5000)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user