Merge pull request #3812 from baude/perffix1

performance fix for podman events with large journalds
This commit is contained in:
OpenShift Merge Robot 2019-08-15 13:39:06 +02:00 committed by GitHub
commit 3f1657d729
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -73,6 +73,11 @@ func (e EventJournalD) Read(options ReadOptions) error {
if err := j.SeekTail(); err != nil {
return errors.Wrap(err, "failed to seek end of journal")
}
} else {
podmanJournal := sdjournal.Match{Field: "SYSLOG_IDENTIFIER", Value: "podman"} //nolint
if err := j.AddMatch(podmanJournal.String()); err != nil {
return errors.Wrap(err, "failed to add filter for event log")
}
}
// the api requires a next|prev before getting a cursor
if _, err := j.Next(); err != nil {