mirror of
https://github.com/offen/docker-volume-backup.git
synced 2024-11-14 10:30:27 +01:00
Docker client expects to be closed after usage in long running program
This commit is contained in:
parent
7cfea62933
commit
68ba6ce5a1
@ -112,6 +112,12 @@ func newScript(c *Config) (*script, error) {
|
||||
return nil, fmt.Errorf("newScript: failed to create docker client")
|
||||
}
|
||||
s.cli = cli
|
||||
s.registerHook(hookLevelPlumbing, func(err error) error {
|
||||
if err := s.cli.Close(); err != nil {
|
||||
return fmt.Errorf("newScript: failed to close docker client: %w", err)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
logFunc := func(logType storage.LogLevel, context string, msg string, params ...any) {
|
||||
|
Loading…
Reference in New Issue
Block a user