Skip to content

Commit

Permalink
Merge pull request subutai-io#751 from subutai-io/updating-state-flow
Browse files Browse the repository at this point in the history
Updating state flow
  • Loading branch information
crioto authored Mar 15, 2018
2 parents bbcf425 + e157cdf commit 2fcd950
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func (np *NetworkPeer) stateConnecting(ptpc *PeerToPeer) error {
return nil
}
if time.Since(started) > time.Duration(time.Millisecond*3000) && np.RemoteState == PeerStateWaitingToConnect {
np.SetState(PeerStateWaitingToConnect, ptpc)
np.SetState(PeerStateDisconnect, ptpc)
return nil
}
time.Sleep(time.Millisecond * 100)
Expand Down Expand Up @@ -276,7 +276,7 @@ func (np *NetworkPeer) stateWaitingForProxy(ptpc *PeerToPeer) error {
func (np *NetworkPeer) stateWaitingToConnect(ptpc *PeerToPeer) error {
Log(Debug, "Waiting for peer [%s] to join connection state", np.ID)
started := time.Now()
timeout := time.Duration(60000 * time.Millisecond)
timeout := time.Duration(30000 * time.Millisecond)
recheck := time.Now()
recheckTimeout := time.Duration(5000 * time.Millisecond)
for {
Expand Down

0 comments on commit 2fcd950

Please sign in to comment.