This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

foreman: Fix frequent tick logic

The foreman has two separate tickers for interacting with the minion:
when the minion is not connected, it tries frequently, and when it is
connected, it tries less often. This code, however, had a bug where it
created a new `connected` variable within the scope of the outer
`connected` variable, rather than assigning the value to the outer
variable. Therefore, the frequent ticker was always used, even if the
minion was already connected.
  • Loading branch information...
kklin committed Nov 30, 2017
1 parent ea65023 commit c0c109c0972adf1d67281d5c37ecdfa5af3e16ab
Showing with 2 additions and 1 deletion.
  1. +2 −1 cloud/foreman/foreman.go
View
@@ -119,7 +119,8 @@ func newMinionImpl(conn db.Conn, cloudID string, stop chan struct{}) {
default:
}
currConfig, connected := runOnce(waitForMachinesCutoff, conn, cloudID)
var currConfig pb.MinionConfig
currConfig, connected = runOnce(waitForMachinesCutoff, conn, cloudID)
setMinionStatus(cloudID, currConfig, connected)
}
}

0 comments on commit c0c109c

Please sign in to comment.