mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-20 20:52:33 +02:00
properly close docker client
This commit is contained in:
parent
68b2d79700
commit
51b8806184
2 changed files with 2 additions and 0 deletions
|
@ -98,6 +98,7 @@ func (r *HTTPRoute) Start(providerSubtask task.Task) E.Error {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
fallback := monitor.NewHTTPHealthChecker(r.rp.TargetURL, r.HealthCheck)
|
fallback := monitor.NewHTTPHealthChecker(r.rp.TargetURL, r.HealthCheck)
|
||||||
r.HealthMon = monitor.NewDockerHealthMonitor(client, r.Idlewatcher.ContainerID, r.HealthCheck, fallback)
|
r.HealthMon = monitor.NewDockerHealthMonitor(client, r.Idlewatcher.ContainerID, r.HealthCheck, fallback)
|
||||||
|
r.task.OnCancel("close docker client", client.Close)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if r.HealthMon == nil {
|
if r.HealthMon == nil {
|
||||||
|
|
|
@ -73,6 +73,7 @@ func (r *StreamRoute) Start(providerSubtask task.Task) E.Error {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
fallback := monitor.NewRawHealthChecker(r.TargetURL(), r.HealthCheck)
|
fallback := monitor.NewRawHealthChecker(r.TargetURL(), r.HealthCheck)
|
||||||
r.HealthMon = monitor.NewDockerHealthMonitor(client, r.Idlewatcher.ContainerID, r.HealthCheck, fallback)
|
r.HealthMon = monitor.NewDockerHealthMonitor(client, r.Idlewatcher.ContainerID, r.HealthCheck, fallback)
|
||||||
|
r.task.OnCancel("close docker client", client.Close)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if r.HealthMon == nil {
|
if r.HealthMon == nil {
|
||||||
|
|
Loading…
Add table
Reference in a new issue