Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
blaubaer committed Oct 18, 2024
1 parent 5fa1783 commit 975e972
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions cmd/bifroest/service_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,17 @@ func (this *windowsService) Execute(_ []string, r <-chan svc.ChangeRequest, chan

go func() {
for {
select {
case c := <-r:
switch c.Cmd {
case svc.Interrogate:
changes <- c.CurrentStatus
// Testing deadlock from https://code.google.com/p/winsvc/issues/detail?id=4
time.Sleep(100 * time.Millisecond)
changes <- c.CurrentStatus
case svc.Stop, svc.Shutdown:
cancelFunc()
default:
_ = this.logger.Error(1, fmt.Errorf("unexpected control request #%d", c).Error())
}
c := <-r
switch c.Cmd {
case svc.Interrogate:
changes <- c.CurrentStatus
// Testing deadlock from https://code.google.com/p/winsvc/issues/detail?id=4
time.Sleep(100 * time.Millisecond)
changes <- c.CurrentStatus
case svc.Stop, svc.Shutdown:
cancelFunc()
default:
_ = this.logger.Error(1, fmt.Errorf("unexpected control request #%d", c).Error())
}
}
}()
Expand Down

0 comments on commit 975e972

Please sign in to comment.