Skip to content

Commit

Permalink
added cutoff check
Browse files Browse the repository at this point in the history
  • Loading branch information
gargidb committed Mar 19, 2020
1 parent 04cd2c4 commit 76ee407
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions outboundSender.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 76ee407

Please sign in to comment.