Skip to content
Snippets Groups Projects
Commit 537e41ef authored by ale's avatar ale
Browse files

made masterelection slightly more verbose

parent 1cd0dc12
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,16 @@ const (
STATE_MASTER
)
func stateToString(state int) string {
switch state {
case STATE_SLAVE:
return "slave"
case STATE_MASTER:
return "master"
}
return ""
}
type MasterElection struct {
client *etcd.Client
stop chan bool
......@@ -49,6 +59,7 @@ func (m *MasterElection) setState(state int) {
if m.State == state {
return
}
log.Printf("masterelection: status=%s", stateToString(state))
if m.StateChange != nil {
m.StateChange <- state
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment