Skip to content

Commit

Permalink
Merge pull request #12 from WilliButz/fix-systemd-journal-metrics
Browse files Browse the repository at this point in the history
fix non-updating metrics from systemd-journal
  • Loading branch information
BartVerc authored Apr 19, 2018
2 parents 1d58438 + ec3a8e5 commit b572eee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions postfix_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,10 @@ func (e *PostfixExporter) CollectLogfileFromJournal() error {
e.journal.Lock()
defer e.journal.Unlock()

r := e.journal.Wait(time.Duration(1) * time.Second)
if r < 0 {
log.Print("error while waiting for journal!")
}
for {
m, c, err := e.journal.NextMessage()
if err != nil {
Expand Down

0 comments on commit b572eee

Please sign in to comment.