From 049a7b030d3ba14545db9e5c110942a1f52210c0 Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Thu, 11 Aug 2016 19:07:13 -0700 Subject: [PATCH] fs uses timed unblocker like logs command --- command/fs.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/command/fs.go b/command/fs.go index 32a6145b5..14eb621b2 100644 --- a/command/fs.go +++ b/command/fs.go @@ -289,7 +289,7 @@ func (f *FSCommand) Run(args []string) int { // If numLines is set, wrap the reader if numLines != -1 { - r = NewLineLimitReader(r, int(numLines), int(numLines*bytesToLines), 0) + r = NewLineLimitReader(r, int(numLines), int(numLines*bytesToLines), 1*time.Second) } } @@ -324,11 +324,12 @@ func (f *FSCommand) followFile(client *api.Client, alloc *api.Allocation, // Create a reader var r io.ReadCloser frameReader := api.NewFrameReader(frames, cancel) + frameReader.SetUnblockTime(500 * time.Millisecond) r = frameReader // If numLines is set, wrap the reader if numLines != -1 { - r = NewLineLimitReader(r, int(numLines), int(numLines*bytesToLines), 0) + r = NewLineLimitReader(r, int(numLines), int(numLines*bytesToLines), 1*time.Second) } go func() {