mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-09 17:53:59 +00:00
Make the restart on wakeup configurable
This commit is contained in:
parent
85dba25246
commit
13602b6769
@ -598,7 +598,9 @@ nextRepo:
|
|||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
go standbyMonitor()
|
if cfg.Options.RestartOnWakeup {
|
||||||
|
go standbyMonitor()
|
||||||
|
}
|
||||||
|
|
||||||
events.Default.Log(events.StartupComplete, nil)
|
events.Default.Log(events.StartupComplete, nil)
|
||||||
go generateEvents()
|
go generateEvents()
|
||||||
|
@ -126,6 +126,7 @@ type OptionsConfiguration struct {
|
|||||||
UPnPLease int `xml:"upnpLeaseMinutes" default:"0"`
|
UPnPLease int `xml:"upnpLeaseMinutes" default:"0"`
|
||||||
UPnPRenewal int `xml:"upnpRenewalMinutes" default:"30"`
|
UPnPRenewal int `xml:"upnpRenewalMinutes" default:"30"`
|
||||||
URAccepted int `xml:"urAccepted"` // Accepted usage reporting version; 0 for off (undecided), -1 for off (permanently)
|
URAccepted int `xml:"urAccepted"` // Accepted usage reporting version; 0 for off (undecided), -1 for off (permanently)
|
||||||
|
RestartOnWakeup bool `xml:"restartOnWakeup" default:"true"`
|
||||||
|
|
||||||
Deprecated_RescanIntervalS int `xml:"rescanIntervalS,omitempty" json:"-"`
|
Deprecated_RescanIntervalS int `xml:"rescanIntervalS,omitempty" json:"-"`
|
||||||
Deprecated_UREnabled bool `xml:"urEnabled,omitempty" json:"-"`
|
Deprecated_UREnabled bool `xml:"urEnabled,omitempty" json:"-"`
|
||||||
|
@ -37,6 +37,7 @@ func TestDefaultValues(t *testing.T) {
|
|||||||
UPnPEnabled: true,
|
UPnPEnabled: true,
|
||||||
UPnPLease: 0,
|
UPnPLease: 0,
|
||||||
UPnPRenewal: 30,
|
UPnPRenewal: 30,
|
||||||
|
RestartOnWakeup: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg := New("test", node1)
|
cfg := New("test", node1)
|
||||||
@ -128,6 +129,7 @@ func TestOverriddenValues(t *testing.T) {
|
|||||||
UPnPEnabled: false,
|
UPnPEnabled: false,
|
||||||
UPnPLease: 60,
|
UPnPLease: 60,
|
||||||
UPnPRenewal: 15,
|
UPnPRenewal: 15,
|
||||||
|
RestartOnWakeup: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg, err := Load("testdata/overridenvalues.xml", node1)
|
cfg, err := Load("testdata/overridenvalues.xml", node1)
|
||||||
|
1
config/testdata/overridenvalues.xml
vendored
1
config/testdata/overridenvalues.xml
vendored
@ -15,5 +15,6 @@
|
|||||||
<upnpEnabled>false</upnpEnabled>
|
<upnpEnabled>false</upnpEnabled>
|
||||||
<upnpLeaseMinutes>60</upnpLeaseMinutes>
|
<upnpLeaseMinutes>60</upnpLeaseMinutes>
|
||||||
<upnpRenewalMinutes>15</upnpRenewalMinutes>
|
<upnpRenewalMinutes>15</upnpRenewalMinutes>
|
||||||
|
<restartOnWakeup>false</restartOnWakeup>
|
||||||
</options>
|
</options>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
Loading…
Reference in New Issue
Block a user