Skip to content

Commit

Permalink
Review improvements 1
Browse files Browse the repository at this point in the history
  • Loading branch information
flotter committed Aug 6, 2024
1 parent b7e28c8 commit b0df183
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions internals/overlord/overlord.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ func (o *Overlord) Loop() {
}
}
})
o.ensureWaitRun()
o.waitEnsureRun()
}

func (o *Overlord) ensureDidRun() {
Expand All @@ -383,22 +383,22 @@ func (o *Overlord) ensureDidRun() {
}
}

// ensureWaitRun waits until StateEngine.Ensure() was called at least once.
func (o *Overlord) ensureWaitRun() {
// waitEnsureRun waits until StateEngine.Ensure() was called at least once.
func (o *Overlord) waitEnsureRun() {
select {
case <-o.ensureRun:
case <-o.loopTomb.Dying():
}
}

func (o *Overlord) CanStandby() (ensured bool) {
func (o *Overlord) CanStandby() bool {
select {
case <-o.ensureRun:
// Already closed. Ensure already ran at least once.
ensured = true
return true
default:
return false
}
return ensured
}

// Stop stops the ensure loop and the managers under the StateEngine.
Expand Down

0 comments on commit b0df183

Please sign in to comment.