fix non-updating metrics from systemd-journal

fixes #10 where metrics metrics collected from the
systemd journal were not updated after some time
This commit is contained in:
WilliButz 2018-04-15 15:47:06 +02:00
parent 1d584386e4
commit ec3a8e5444
No known key found for this signature in database
GPG Key ID: 92582A10F1179CB2

View File

@ -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 {