Skip to content

Commit

Permalink
flush every message, not just first 300
Browse files Browse the repository at this point in the history
  • Loading branch information
nicpottier committed Aug 21, 2017
1 parent b330039 commit 5495a48
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions librato/librato.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,16 @@ func (c *Sender) Start() {
for {
select {
case <-c.stop:
c.flush(1000)
for len(c.buffer) > 0 {
c.flush(250)
}
logrus.WithField("comp", "librato").Info("stopped")
return

case <-time.After(c.timeout * time.Second):
c.flush(300)
for i := 0; i < 4; i++ {
c.flush(250)
}
}
}
}()
Expand Down

0 comments on commit 5495a48

Please sign in to comment.