mirror of
https://github.com/offen/docker-volume-backup.git
synced 2024-11-22 05:10:28 +01:00
Docker client expects to be closed after usage in long running program
This commit is contained in:
parent
65626dd3d4
commit
de03d4f704
@ -112,6 +112,12 @@ func newScript(c *Config) (*script, error) {
|
|||||||
return nil, fmt.Errorf("newScript: failed to create docker client")
|
return nil, fmt.Errorf("newScript: failed to create docker client")
|
||||||
}
|
}
|
||||||
s.cli = cli
|
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) {
|
logFunc := func(logType storage.LogLevel, context string, msg string, params ...any) {
|
||||||
|
Loading…
Reference in New Issue
Block a user