Handle Backoff during shutdown.

This commit is contained in:
Ryan Bourgeois 2013-12-02 13:25:14 -08:00
parent 9dfcc080fc
commit 386c28cfa3

View File

@ -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)