Improve starting and stopping

This commit is contained in:
Daniel
2024-11-08 14:39:28 +01:00
parent 34894ea7d6
commit 2d0d711938
4 changed files with 12 additions and 16 deletions

View File

@@ -52,6 +52,8 @@ func (s *LinuxSystemService) Run() {
wait:
for {
select {
case <-s.instance.ShuttingDown():
break wait
case sig := <-signalCh:
// Only print and continue to wait if SIGUSR1
if sig == syscall.SIGUSR1 {
@@ -64,8 +66,6 @@ wait:
s.instance.Shutdown()
break wait
}
case <-s.instance.ShuttingDown():
break wait
}
}