cmd/syncthing: Correct auto upgrade criteria (fixes #6701) (#6702)

This commit is contained in:
Jakob Borg 2020-06-02 10:38:39 +01:00 committed by GitHub
parent d9cb7e2739
commit bfc9478965
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -842,7 +842,7 @@ func shouldUpgrade(cfg config.Wrapper, runtimeOptions RuntimeOptions) bool {
if upgrade.DisabledByCompilation {
return false
}
if opts := cfg.Options(); opts.AutoUpgradeIntervalH < 0 {
if !cfg.Options().ShouldAutoUpgrade() {
return false
}
if runtimeOptions.NoUpgrade {

View File

@ -200,3 +200,7 @@ func (opts OptionsConfiguration) MaxConcurrentIncomingRequestKiB() int {
// Roll with it.
return opts.RawMaxCIRequestKiB
}
func (opts OptionsConfiguration) ShouldAutoUpgrade() bool {
return opts.AutoUpgradeIntervalH > 0
}