Beispiel #1
0
// runCheck immediately pushes a TTL check.  Assumes c.serviceLock is held
// exclusively.
func (c *ConsulBackend) runCheck() {
	// Reset timer before calling run check in order to not slide the
	// window of the next check.
	c.checkTimer.Reset(lib.DurationMinusBuffer(c.checkTimeout, checkMinBuffer, checkJitterFactor))

	// Run a TTL check
	agent := c.client.Agent()
	if c.unsealed {
		agent.PassTTL(c.checkID(), "Vault Unsealed")
	} else {
		agent.FailTTL(c.checkID(), "Vault Sealed")
	}
}
Beispiel #2
0
func (c *ConsulBackend) checkDuration() time.Duration {
	return lib.DurationMinusBuffer(c.checkTimeout, checkMinBuffer, checkJitterFactor)
}