mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-13 18:54:21 +01:00
🎨 Improve WebDAV/S3 data sync request timeout settings https://github.com/siyuan-note/siyuan/issues/12734
This commit is contained in:
parent
61e07a1ed1
commit
e334478214
3 changed files with 9 additions and 6 deletions
|
|
@ -648,20 +648,23 @@ func planSyncAfter(d time.Duration) {
|
|||
func isProviderOnline(byHand bool) (ret bool) {
|
||||
checkURL := util.GetCloudSyncServer()
|
||||
skipTlsVerify := false
|
||||
timeout := 3000
|
||||
switch Conf.Sync.Provider {
|
||||
case conf.ProviderSiYuan:
|
||||
case conf.ProviderS3:
|
||||
checkURL = Conf.Sync.S3.Endpoint
|
||||
skipTlsVerify = Conf.Sync.S3.SkipTlsVerify
|
||||
timeout = Conf.Sync.S3.Timeout * 1000
|
||||
case conf.ProviderWebDAV:
|
||||
checkURL = Conf.Sync.WebDAV.Endpoint
|
||||
skipTlsVerify = Conf.Sync.WebDAV.SkipTlsVerify
|
||||
timeout = Conf.Sync.WebDAV.Timeout * 1000
|
||||
default:
|
||||
logging.LogWarnf("unknown provider: %d", Conf.Sync.Provider)
|
||||
return false
|
||||
}
|
||||
|
||||
if ret = util.IsOnline(checkURL, skipTlsVerify); !ret {
|
||||
if ret = util.IsOnline(checkURL, skipTlsVerify, timeout); !ret {
|
||||
if 1 > autoSyncErrCount || byHand {
|
||||
util.PushErrMsg(Conf.Language(76)+" (Provider: "+conf.ProviderToStr(Conf.Sync.Provider)+")", 5000)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue