mirror of
https://github.com/octoleo/syncthing.git
synced 2025-02-08 14:58:26 +00:00
lib/connections: Fully dial resumed devices (#7798)
This commit is contained in:
parent
89e762fd6e
commit
1921533c4c
@ -786,13 +786,23 @@ func (s *service) CommitConfiguration(from, to config.Configuration) bool {
|
|||||||
|
|
||||||
func (s *service) checkAndSignalConnectLoopOnUpdatedDevices(from, to config.Configuration) {
|
func (s *service) checkAndSignalConnectLoopOnUpdatedDevices(from, to config.Configuration) {
|
||||||
oldDevices := from.DeviceMap()
|
oldDevices := from.DeviceMap()
|
||||||
|
dial := false
|
||||||
|
s.dialNowDevicesMut.Lock()
|
||||||
for _, dev := range to.Devices {
|
for _, dev := range to.Devices {
|
||||||
oldDev, ok := oldDevices[dev.DeviceID]
|
if dev.Paused {
|
||||||
if !ok || !util.EqualStrings(oldDev.Addresses, dev.Addresses) {
|
continue
|
||||||
s.scheduleDialNow()
|
}
|
||||||
break
|
if oldDev, ok := oldDevices[dev.DeviceID]; !ok || oldDev.Paused {
|
||||||
|
s.dialNowDevices[dev.DeviceID] = struct{}{}
|
||||||
|
dial = true
|
||||||
|
} else if !util.EqualStrings(oldDev.Addresses, dev.Addresses) {
|
||||||
|
dial = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if dial {
|
||||||
|
s.scheduleDialNow()
|
||||||
|
}
|
||||||
|
s.dialNowDevicesMut.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *service) scheduleDialNow() {
|
func (s *service) scheduleDialNow() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user