mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01: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
011ad83b6a
commit
7dd4a2db9e
1 changed files with 6 additions and 5 deletions
|
|
@ -567,18 +567,19 @@ func planSyncAfter(d time.Duration) {
|
|||
}
|
||||
|
||||
func isProviderOnline() (ret bool) {
|
||||
checkURL := util.SiYuanSyncServer
|
||||
switch Conf.Sync.Provider {
|
||||
case conf.ProviderSiYuan:
|
||||
ret = util.IsOnline(util.SiYuanSyncServer)
|
||||
case conf.ProviderS3:
|
||||
ret = util.IsOnline(Conf.Sync.S3.Endpoint)
|
||||
checkURL = Conf.Sync.S3.Endpoint
|
||||
case conf.ProviderWebDAV:
|
||||
ret = util.IsOnline(Conf.Sync.WebDAV.Endpoint)
|
||||
checkURL = Conf.Sync.WebDAV.Endpoint
|
||||
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)
|
||||
}
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue