summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
Diffstat (limited to 'libpod')
-rw-r--r--libpod/container_log.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/libpod/container_log.go b/libpod/container_log.go
index 9a2f8aa2f..67380397a 100644
--- a/libpod/container_log.go
+++ b/libpod/container_log.go
@@ -7,6 +7,7 @@ import (
"github.com/containers/libpod/libpod/define"
"github.com/containers/libpod/libpod/logs"
+ "github.com/hpcloud/tail/watch"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)
@@ -88,8 +89,8 @@ func (c *Container) readFromLogFile(options *logs.LogOptions, logChannel chan *l
go func() {
for {
state, err := c.State()
+ time.Sleep(watch.POLL_DURATION)
if err != nil {
- time.Sleep(250 * time.Millisecond)
tailError := t.StopAtEOF()
if tailError != nil && fmt.Sprintf("%v", tailError) != "tail: stop at eof" {
logrus.Error(tailError)
@@ -100,14 +101,12 @@ func (c *Container) readFromLogFile(options *logs.LogOptions, logChannel chan *l
break
}
if state != define.ContainerStateRunning && state != define.ContainerStatePaused {
- time.Sleep(250 * time.Millisecond)
tailError := t.StopAtEOF()
if tailError != nil && fmt.Sprintf("%v", tailError) != "tail: stop at eof" {
logrus.Error(tailError)
}
break
}
- time.Sleep(250 * time.Millisecond)
}
}()
}