mirror of
https://github.com/rynbrd/go-service.git
synced 2024-07-22 16:58:31 +08:00
Handle Backoff during shutdown.
This commit is contained in:
parent
9dfcc080fc
commit
386c28cfa3
@ -225,7 +225,10 @@ func (s *Service) Run(commands <-chan Command, events chan<- Event) {
|
||||
if lastCmd != nil {
|
||||
lastCmd.respond(s, errors.New("service is shutting down"))
|
||||
}
|
||||
if s.state == Stopped || s.state == Exited {
|
||||
if s.state == Stopped || s.state == Exited || s.state == Backoff {
|
||||
if s.state == Backoff {
|
||||
s.state = Exited
|
||||
}
|
||||
quit <- true
|
||||
} else if s.state == Running {
|
||||
stop(cmd)
|
||||
|
Loading…
Reference in New Issue
Block a user