diff options
author | Jakob Borg <jakob@nym.se> | 2016-05-09 11:30:19 +0000 |
---|---|---|
committer | Audrius Butkevicius <audrius.butkevicius@gmail.com> | 2016-05-09 11:30:19 +0000 |
commit | 8b7b0a03ebc733e75ea6743af3d60b8d8d504325 (patch) | |
tree | d23542a4b21074892642e641495334ff17cd9582 | |
parent | 0761d804a48f0fc6e720392ee32c3446385026c9 (diff) |
lib/config: Don't require restart when adding folders/devices or changing listen address
The VersioningConfig change is because it defaults to nil but gets
deserialized to map[string]string{}. Now prepare() enforces a single
representation of the empty map.
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3065
-rw-r--r-- | lib/config/folderconfiguration.go | 4 | ||||
-rw-r--r-- | lib/model/model.go | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/lib/config/folderconfiguration.go b/lib/config/folderconfiguration.go index 07d4670a9d..4b85d870d0 100644 --- a/lib/config/folderconfiguration.go +++ b/lib/config/folderconfiguration.go @@ -138,6 +138,10 @@ func (f *FolderConfiguration) prepare() { } else if f.RescanIntervalS < 0 { f.RescanIntervalS = 0 } + + if f.Versioning.Params == nil { + f.Versioning.Params = make(map[string]string) + } } func (f *FolderConfiguration) cleanedPath() string { diff --git a/lib/model/model.go b/lib/model/model.go index ab5e2b6aaa..0caef68a71 100644 --- a/lib/model/model.go +++ b/lib/model/model.go @@ -2018,6 +2018,7 @@ func (m *Model) CommitConfiguration(from, to config.Configuration) bool { // by themselves. from.Options.URAccepted = to.Options.URAccepted from.Options.URUniqueID = to.Options.URUniqueID + from.Options.ListenAddresses = to.Options.ListenAddresses // All of the other generic options require restart. Or at least they may; // removing this check requires going through those options carefully and // making sure there are individual services that handle them correctly. |