lib/config: Disable cacheIgnoredFiles, new default is disabled
This commit is contained in:
parent
7b4e1e9055
commit
a4f0b85462
@ -21,7 +21,7 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
OldestHandledVersion = 10
|
OldestHandledVersion = 10
|
||||||
CurrentVersion = 12
|
CurrentVersion = 13
|
||||||
MaxRescanIntervalS = 365 * 24 * 60 * 60
|
MaxRescanIntervalS = 365 * 24 * 60 * 60
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -182,6 +182,9 @@ func (cfg *Configuration) prepare(myID protocol.DeviceID) {
|
|||||||
if cfg.Version == 11 {
|
if cfg.Version == 11 {
|
||||||
convertV11V12(cfg)
|
convertV11V12(cfg)
|
||||||
}
|
}
|
||||||
|
if cfg.Version == 12 {
|
||||||
|
convertV12V13(cfg)
|
||||||
|
}
|
||||||
|
|
||||||
// Build a list of available devices
|
// Build a list of available devices
|
||||||
existingDevices := make(map[protocol.DeviceID]bool)
|
existingDevices := make(map[protocol.DeviceID]bool)
|
||||||
@ -235,6 +238,13 @@ func (cfg *Configuration) prepare(myID protocol.DeviceID) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func convertV12V13(cfg *Configuration) {
|
||||||
|
// Not using the ignore cache is the new default. Disable it on existing
|
||||||
|
// configurations.
|
||||||
|
cfg.Options.CacheIgnoredFiles = false
|
||||||
|
cfg.Version = 13
|
||||||
|
}
|
||||||
|
|
||||||
func convertV11V12(cfg *Configuration) {
|
func convertV11V12(cfg *Configuration) {
|
||||||
// Change listen address schema
|
// Change listen address schema
|
||||||
for i, addr := range cfg.Options.ListenAddress {
|
for i, addr := range cfg.Options.ListenAddress {
|
||||||
|
|||||||
@ -51,7 +51,7 @@ func TestDefaultValues(t *testing.T) {
|
|||||||
RestartOnWakeup: true,
|
RestartOnWakeup: true,
|
||||||
AutoUpgradeIntervalH: 12,
|
AutoUpgradeIntervalH: 12,
|
||||||
KeepTemporariesH: 24,
|
KeepTemporariesH: 24,
|
||||||
CacheIgnoredFiles: true,
|
CacheIgnoredFiles: false,
|
||||||
ProgressUpdateIntervalS: 5,
|
ProgressUpdateIntervalS: 5,
|
||||||
SymlinksEnabled: true,
|
SymlinksEnabled: true,
|
||||||
LimitBandwidthInLan: false,
|
LimitBandwidthInLan: false,
|
||||||
@ -180,7 +180,7 @@ func TestOverriddenValues(t *testing.T) {
|
|||||||
RestartOnWakeup: false,
|
RestartOnWakeup: false,
|
||||||
AutoUpgradeIntervalH: 24,
|
AutoUpgradeIntervalH: 24,
|
||||||
KeepTemporariesH: 48,
|
KeepTemporariesH: 48,
|
||||||
CacheIgnoredFiles: false,
|
CacheIgnoredFiles: true,
|
||||||
ProgressUpdateIntervalS: 10,
|
ProgressUpdateIntervalS: 10,
|
||||||
SymlinksEnabled: false,
|
SymlinksEnabled: false,
|
||||||
LimitBandwidthInLan: true,
|
LimitBandwidthInLan: true,
|
||||||
|
|||||||
@ -32,7 +32,7 @@ type OptionsConfiguration struct {
|
|||||||
RestartOnWakeup bool `xml:"restartOnWakeup" json:"restartOnWakeup" default:"true"`
|
RestartOnWakeup bool `xml:"restartOnWakeup" json:"restartOnWakeup" default:"true"`
|
||||||
AutoUpgradeIntervalH int `xml:"autoUpgradeIntervalH" json:"autoUpgradeIntervalH" default:"12"` // 0 for off
|
AutoUpgradeIntervalH int `xml:"autoUpgradeIntervalH" json:"autoUpgradeIntervalH" default:"12"` // 0 for off
|
||||||
KeepTemporariesH int `xml:"keepTemporariesH" json:"keepTemporariesH" default:"24"` // 0 for off
|
KeepTemporariesH int `xml:"keepTemporariesH" json:"keepTemporariesH" default:"24"` // 0 for off
|
||||||
CacheIgnoredFiles bool `xml:"cacheIgnoredFiles" json:"cacheIgnoredFiles" default:"true"`
|
CacheIgnoredFiles bool `xml:"cacheIgnoredFiles" json:"cacheIgnoredFiles" default:"false"`
|
||||||
ProgressUpdateIntervalS int `xml:"progressUpdateIntervalS" json:"progressUpdateIntervalS" default:"5"`
|
ProgressUpdateIntervalS int `xml:"progressUpdateIntervalS" json:"progressUpdateIntervalS" default:"5"`
|
||||||
SymlinksEnabled bool `xml:"symlinksEnabled" json:"symlinksEnabled" default:"true"`
|
SymlinksEnabled bool `xml:"symlinksEnabled" json:"symlinksEnabled" default:"true"`
|
||||||
LimitBandwidthInLan bool `xml:"limitBandwidthInLan" json:"limitBandwidthInLan" default:"false"`
|
LimitBandwidthInLan bool `xml:"limitBandwidthInLan" json:"limitBandwidthInLan" default:"false"`
|
||||||
|
|||||||
6
lib/config/testdata/overridenvalues.xml
vendored
6
lib/config/testdata/overridenvalues.xml
vendored
@ -1,6 +1,6 @@
|
|||||||
<configuration version="11">
|
<configuration version="13">
|
||||||
<options>
|
<options>
|
||||||
<listenAddress>:23000</listenAddress>
|
<listenAddress>tcp://:23000</listenAddress>
|
||||||
<allowDelete>false</allowDelete>
|
<allowDelete>false</allowDelete>
|
||||||
<globalAnnounceServer>udp4://syncthing.nym.se:22026</globalAnnounceServer>
|
<globalAnnounceServer>udp4://syncthing.nym.se:22026</globalAnnounceServer>
|
||||||
<globalAnnounceEnabled>false</globalAnnounceEnabled>
|
<globalAnnounceEnabled>false</globalAnnounceEnabled>
|
||||||
@ -24,7 +24,7 @@
|
|||||||
<restartOnWakeup>false</restartOnWakeup>
|
<restartOnWakeup>false</restartOnWakeup>
|
||||||
<autoUpgradeIntervalH>24</autoUpgradeIntervalH>
|
<autoUpgradeIntervalH>24</autoUpgradeIntervalH>
|
||||||
<keepTemporariesH>48</keepTemporariesH>
|
<keepTemporariesH>48</keepTemporariesH>
|
||||||
<cacheIgnoredFiles>false</cacheIgnoredFiles>
|
<cacheIgnoredFiles>true</cacheIgnoredFiles>
|
||||||
<progressUpdateIntervalS>10</progressUpdateIntervalS>
|
<progressUpdateIntervalS>10</progressUpdateIntervalS>
|
||||||
<symlinksEnabled>false</symlinksEnabled>
|
<symlinksEnabled>false</symlinksEnabled>
|
||||||
<limitBandwidthInLan>true</limitBandwidthInLan>
|
<limitBandwidthInLan>true</limitBandwidthInLan>
|
||||||
|
|||||||
14
lib/config/testdata/v13.xml
vendored
Normal file
14
lib/config/testdata/v13.xml
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<configuration version="13">
|
||||||
|
<folder id="test" path="testdata" ro="true" ignorePerms="false" rescanIntervalS="600" autoNormalize="true">
|
||||||
|
<device id="AIR6LPZ-7K4PTTV-UXQSMUU-CPQ5YWH-OEDFIIQ-JUG777G-2YQXXR5-YD6AWQR"></device>
|
||||||
|
<device id="P56IOI7-MZJNU2Y-IQGDREY-DM2MGTI-MGL3BXN-PQ6W5BM-TBBZ4TJ-XZWICQ2"></device>
|
||||||
|
<minDiskFreePct>1</minDiskFreePct>
|
||||||
|
<maxConflicts>-1</maxConflicts>
|
||||||
|
</folder>
|
||||||
|
<device id="AIR6LPZ-7K4PTTV-UXQSMUU-CPQ5YWH-OEDFIIQ-JUG777G-2YQXXR5-YD6AWQR" name="node one" compression="metadata">
|
||||||
|
<address>tcp://a</address>
|
||||||
|
</device>
|
||||||
|
<device id="P56IOI7-MZJNU2Y-IQGDREY-DM2MGTI-MGL3BXN-PQ6W5BM-TBBZ4TJ-XZWICQ2" name="node two" compression="metadata">
|
||||||
|
<address>tcp://b</address>
|
||||||
|
</device>
|
||||||
|
</configuration>
|
||||||
Loading…
x
Reference in New Issue
Block a user