make cool-off error message less obscure

This commit is contained in:
Sridhar Ratnakumar 2014-04-28 12:49:23 -07:00
parent d21b644dea
commit 64e99b360f
1 changed files with 5 additions and 5 deletions

10
tail.go
View File

@ -219,13 +219,13 @@ func (tail *Tail) tailFileSync() {
if line != nil { if line != nil {
cooloff := !tail.sendLine(line) cooloff := !tail.sendLine(line)
if cooloff { if cooloff {
msg := "Too much activity; entering a cool-off period"
tail.Lines <- &Line{
msg,
time.Now(),
fmt.Errorf(msg)}
// Wait a second before seeking till the end of // Wait a second before seeking till the end of
// file when rate limit is reached. // file when rate limit is reached.
msg := fmt.Sprintf(
"Too much log activity (more than %d lines "+
"per second being written); waiting a second "+
"before resuming tailing", tail.LimitRate)
tail.Lines <- &Line{msg, time.Now(), fmt.Errorf(msg)}
select { select {
case <-time.After(time.Second): case <-time.After(time.Second):
case <-tail.Dying(): case <-tail.Dying():