diff --git a/CHANGELOG.md b/CHANGELOG.md index 9964eedb..5de391f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] - adding docker automation [#184](https://github.com/xmidt-org/caduceus/pull/184) +- fixing caduceus queue cutoffs [#185](https://github.com/xmidt-org/caduceus/issues/185) ## [v0.2.3] - updated release pipeline to use travis [#174](https://github.com/xmidt-org/caduceus/pull/174) diff --git a/outboundSender.go b/outboundSender.go index 7fcfc7bf..cc2e01de 100644 --- a/outboundSender.go +++ b/outboundSender.go @@ -603,6 +603,10 @@ func (obs *CaduceusOutboundSender) send(urls *ring.Ring, secret, acceptType stri // queueOverflow handles the logic of what to do when a queue overflows func (obs *CaduceusOutboundSender) queueOverflow() { obs.mutex.Lock() + if time.Now().Before(obs.dropUntil) { + obs.mutex.Unlock() + return + } obs.dropUntil = time.Now().Add(obs.cutOffPeriod) obs.dropUntilGauge.Set(float64(obs.dropUntil.Unix())) secret := obs.listener.Config.Secret