Skip to content

Commit b572eee

Browse files
authored
Merge pull request #12 from WilliButz/fix-systemd-journal-metrics
fix non-updating metrics from systemd-journal
2 parents 1d58438 + ec3a8e5 commit b572eee

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

postfix_exporter.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,10 @@ func (e *PostfixExporter) CollectLogfileFromJournal() error {
409409
e.journal.Lock()
410410
defer e.journal.Unlock()
411411

412+
r := e.journal.Wait(time.Duration(1) * time.Second)
413+
if r < 0 {
414+
log.Print("error while waiting for journal!")
415+
}
412416
for {
413417
m, c, err := e.journal.NextMessage()
414418
if err != nil {

0 commit comments

Comments
 (0)