mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-25 10:18:59 +02:00
fix(health): remove unnecessary containerId parameter
This commit is contained in:
@@ -35,7 +35,7 @@ func NewDockerHealthcheckState(client *docker.SharedClient, containerId string)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Docker(ctx context.Context, state *DockerHealthcheckState, containerId string, timeout time.Duration) (types.HealthCheckResult, error) {
|
func Docker(ctx context.Context, state *DockerHealthcheckState, timeout time.Duration) (types.HealthCheckResult, error) {
|
||||||
if state.numDockerFailures > dockerFailuresThreshold {
|
if state.numDockerFailures > dockerFailuresThreshold {
|
||||||
return types.HealthCheckResult{}, ErrDockerHealthCheckFailedTooManyTimes
|
return types.HealthCheckResult{}, ErrDockerHealthCheckFailedTooManyTimes
|
||||||
}
|
}
|
||||||
@@ -44,7 +44,7 @@ func Docker(ctx context.Context, state *DockerHealthcheckState, containerId stri
|
|||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
// the actual inspect response is intercepted and returned as RequestInterceptedError
|
// the actual inspect response is intercepted and returned as RequestInterceptedError
|
||||||
_, err := state.client.ContainerInspect(ctx, containerId, client.ContainerInspectOptions{})
|
_, err := state.client.ContainerInspect(ctx, state.containerId, client.ContainerInspectOptions{})
|
||||||
|
|
||||||
var interceptedErr *httputils.RequestInterceptedError
|
var interceptedErr *httputils.RequestInterceptedError
|
||||||
if !httputils.AsRequestInterceptedError(err, &interceptedErr) {
|
if !httputils.AsRequestInterceptedError(err, &interceptedErr) {
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ func NewDockerHealthMonitor(config types.HealthCheckConfig, client *docker.Share
|
|||||||
|
|
||||||
var mon monitor
|
var mon monitor
|
||||||
mon.init(displayURL, config, func(u *url.URL) (result Result, err error) {
|
mon.init(displayURL, config, func(u *url.URL) (result Result, err error) {
|
||||||
result, err = healthcheck.Docker(mon.Context(), state, containerId, config.Timeout)
|
result, err = healthcheck.Docker(mon.Context(), state, config.Timeout)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if isFirstFailure {
|
if isFirstFailure {
|
||||||
isFirstFailure = false
|
isFirstFailure = false
|
||||||
|
|||||||
Reference in New Issue
Block a user