MCPcopy
hub / github.com/caddyserver/caddy / countFail

Method countFail

modules/caddyhttp/reverseproxy/hosts.go:215–221  ·  view source on GitHub ↗

countFail mutates the recent failures count by delta. It returns an error if the adjustment fails.

(delta int)

Source from the content-addressed store, hash-verified

213// countFail mutates the recent failures count by
214// delta. It returns an error if the adjustment fails.
215func (h *Host) countFail(delta int) error {
216 result := h.fails.Add(int64(delta))
217 if result < 0 {
218 return fmt.Errorf("count below 0: %d", result)
219 }
220 return nil
221}
222
223// countHealthPass mutates the recent passes count by
224// delta. It returns an error if the adjustment fails.

Calls 1

AddMethod · 0.45