Skip to content

Commit

Permalink
fix non-updating metrics from systemd-journal
Browse files Browse the repository at this point in the history
fixes #10 where metrics metrics collected from the
systemd journal were not updated after some time
  • Loading branch information
WilliButz committed Apr 15, 2018
1 parent 1d58438 commit ec3a8e5
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 ec3a8e5

Please sign in to comment.