🎨 S3/WebDAV 数据同步支持设置超时时间 Fix https://github.com/siyuan-note/siyuan/issues/6781

This commit is contained in:
Liang Ding 2022-12-04 20:42:35 +08:00
parent 4629e15f57
commit faa2d2d655
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
9 changed files with 72 additions and 7 deletions

View file

@ -161,6 +161,19 @@ func GetChildDocDepth(treeAbsPath string) (ret int) {
return
}
func NormalizeTimeout(timeout int) int {
if 7 > timeout {
if 1 > timeout {
return 30
}
return 7
}
if 300 < timeout {
return 300
}
return timeout
}
func NormalizeEndpoint(endpoint string) string {
endpoint = strings.TrimSpace(endpoint)
if "" == endpoint {