beacon/light/request: nicer trigger wait loop

Co-authored-by: Martin HS <martin@swende.se>
This commit is contained in:
Felföldi Zsolt 2024-02-01 13:15:20 +01:00 committed by GitHub
parent eceba4c6f7
commit 7fa0a003d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 10 deletions

View File

@ -203,18 +203,16 @@ func (s *Scheduler) syncLoop() {
s.lock.Lock()
s.processRound()
s.lock.Unlock()
loop:
for {
for triggered := false; !triggered; {
select {
case stop := <-s.stopCh:
close(stop)
return
case <-s.triggerCh:
break loop
triggered = true
case <-s.testWaitCh:
}
}
}
}
// targetChanged returns true if a registered target data structure has been