summaryrefslogtreecommitdiff
path: root/libpod/events/logfile.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/events/logfile.go')
-rw-r--r--libpod/events/logfile.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/libpod/events/logfile.go b/libpod/events/logfile.go
index 57e38b815..05ae3ce52 100644
--- a/libpod/events/logfile.go
+++ b/libpod/events/logfile.go
@@ -4,7 +4,9 @@ import (
"context"
"fmt"
"os"
+ "time"
+ "github.com/containers/podman/v2/pkg/util"
"github.com/containers/storage"
"github.com/pkg/errors"
)
@@ -51,6 +53,16 @@ func (e EventLogFile) Read(ctx context.Context, options ReadOptions) error {
if err != nil {
return err
}
+ if len(options.Until) > 0 {
+ untilTime, err := util.ParseInputTime(options.Until)
+ if err != nil {
+ return err
+ }
+ go func() {
+ time.Sleep(time.Until(untilTime))
+ t.Stop()
+ }()
+ }
funcDone := make(chan bool)
copy := true
go func() {