Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1789 from weaveworks/dont-stop-dnsing
Browse files Browse the repository at this point in the history
Wait for shutdown before returning from main()
  • Loading branch information
squaremo committed Mar 4, 2019
2 parents 8c82f10 + f0ab7f1 commit 44874ea
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions cmd/fluxd/main.go
Expand Up @@ -222,15 +222,6 @@ func main() {
errc <- fmt.Errorf("%s", <-c)
}()

// This means we can return, and it will use the shutdown
// protocol.
defer func() {
// wait here until stopping.
logger.Log("exiting", <-errc)
close(shutdown)
shutdownWg.Wait()
}()

// Cluster component.
var clusterVersion string
var sshKeyRing ssh.KeyRing
Expand Down Expand Up @@ -546,5 +537,8 @@ func main() {
}()
}

// Fall off the end, into the waiting procedure.
// wait here until stopping.
logger.Log("exiting", <-errc)
close(shutdown)
shutdownWg.Wait()
}

0 comments on commit 44874ea

Please sign in to comment.