mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-22 02:48:59 +00:00
wip
This commit is contained in:
parent
a5cbe9b48c
commit
06f58812c3
@ -283,13 +283,13 @@ func (m *model) serve(ctx context.Context) error {
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
l.Infoln("context closed, stopping", ctx.Err())
|
||||
l.Infoln(m, "context closed, stopping", ctx.Err())
|
||||
return ctx.Err()
|
||||
case err := <-m.fatalChan:
|
||||
l.Infoln("fatal error, stopping", err)
|
||||
l.Infoln(m, "fatal error, stopping", err)
|
||||
return svcutil.AsFatalErr(err, svcutil.ExitError)
|
||||
case <-m.promotionTimer.C:
|
||||
l.Infoln("promotion timer fired")
|
||||
l.Infoln(m, "promotion timer fired")
|
||||
m.promoteConnections()
|
||||
}
|
||||
}
|
||||
@ -1217,7 +1217,6 @@ func (m *model) ClusterConfig(conn protocol.Connection, cm protocol.ClusterConfi
|
||||
if cm.Secondary {
|
||||
// No handling of secondary connection ClusterConfigs; they merely
|
||||
// indicate the connection is ready to start.
|
||||
l.Infoln("Ignoring secondary connection cluster-config on connection", conn.ConnectionID())
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -440,8 +440,6 @@ func (c *rawConnection) readerLoop() {
|
||||
}
|
||||
|
||||
func (c *rawConnection) dispatcherLoop() (err error) {
|
||||
l.Infof("dispatcher loop started: %v", err)
|
||||
defer l.Infof("dispatcher loop stopped: %v", err)
|
||||
defer close(c.dispatcherLoopStopped)
|
||||
var msg message
|
||||
state := stateInitial
|
||||
@ -963,7 +961,11 @@ func (c *rawConnection) internalClose(err error) {
|
||||
}
|
||||
c.awaitingMut.Unlock()
|
||||
|
||||
<-c.dispatcherLoopStopped
|
||||
if !c.startTime.IsZero() {
|
||||
// Wait for the dispatcher loop to exit, if it was started to
|
||||
// begin with.
|
||||
<-c.dispatcherLoopStopped
|
||||
}
|
||||
|
||||
c.model.Closed(err)
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user