1
0
镜像自地址 https://github.com/tuna/tunasync.git 已同步 2025-12-06 06:26:46 +00:00

Implement global.rsync_options (fixes #206)

Signed-off-by: Harry Chen <i@harrychen.xyz>
这个提交包含在:
Harry Chen
2025-02-27 16:59:29 +08:00
父节点 27e4307375
当前提交 a64557b86d
共有 4 个文件被更改,包括 73 次插入1 次删除

查看文件

@@ -14,6 +14,7 @@ type rsyncConfig struct {
rsyncCmd string
upstreamURL, username, password, excludeFile string
extraOptions []string
globalOptions []string
overriddenOptions []string
useOverrideOnly bool
rsyncNeverTimeout bool
@@ -80,6 +81,7 @@ func newRsyncProvider(c rsyncConfig) (*rsyncProvider, error) {
if c.overriddenOptions == nil {
return nil, errors.New("rsync_override_only is set but no rsync_override provided")
}
// use overridden options only
} else {
if !c.rsyncNeverTimeout {
timeo := 120
@@ -98,6 +100,10 @@ func newRsyncProvider(c rsyncConfig) (*rsyncProvider, error) {
if c.excludeFile != "" {
options = append(options, "--exclude-from", c.excludeFile)
}
if c.globalOptions != nil {
options = append(options, c.globalOptions...)
}
if c.extraOptions != nil {
options = append(options, c.extraOptions...)
}