Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
autoradio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ale
autoradio
Commits
537e41ef
Commit
537e41ef
authored
11 years ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
made masterelection slightly more verbose
parent
1cd0dc12
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
masterelection/masterelection.go
+11
-0
11 additions, 0 deletions
masterelection/masterelection.go
with
11 additions
and
0 deletions
masterelection/masterelection.go
+
11
−
0
View file @
537e41ef
...
...
@@ -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
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment