Cleanup driver and graph db after stopping containers.
Signed-off-by: David Calavera <david.calavera@gmail.com>
This commit is contained in:
parent
add64dc297
commit
0964a664e8
1 changed files with 12 additions and 10 deletions
|
@ -769,16 +769,6 @@ func NewDaemon(config *Config, registryService *registry.Service) (daemon *Daemo
|
|||
}
|
||||
|
||||
func (daemon *Daemon) Shutdown() error {
|
||||
if daemon.containerGraph != nil {
|
||||
if err := daemon.containerGraph.Close(); err != nil {
|
||||
logrus.Errorf("Error during container graph.Close(): %v", err)
|
||||
}
|
||||
}
|
||||
if daemon.driver != nil {
|
||||
if err := daemon.driver.Cleanup(); err != nil {
|
||||
logrus.Errorf("Error during graph storage driver.Cleanup(): %v", err)
|
||||
}
|
||||
}
|
||||
if daemon.containers != nil {
|
||||
group := sync.WaitGroup{}
|
||||
logrus.Debug("starting clean shutdown of all containers...")
|
||||
|
@ -807,6 +797,18 @@ func (daemon *Daemon) Shutdown() error {
|
|||
}
|
||||
}
|
||||
|
||||
if daemon.containerGraph != nil {
|
||||
if err := daemon.containerGraph.Close(); err != nil {
|
||||
logrus.Errorf("Error during container graph.Close(): %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
if daemon.driver != nil {
|
||||
if err := daemon.driver.Cleanup(); err != nil {
|
||||
logrus.Errorf("Error during graph storage driver.Cleanup(): %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue