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:
parent
1d584386e4
commit
ec3a8e5444
@ -409,6 +409,10 @@ func (e *PostfixExporter) CollectLogfileFromJournal() error {
|
|||||||
e.journal.Lock()
|
e.journal.Lock()
|
||||||
defer e.journal.Unlock()
|
defer e.journal.Unlock()
|
||||||
|
|
||||||
|
r := e.journal.Wait(time.Duration(1) * time.Second)
|
||||||
|
if r < 0 {
|
||||||
|
log.Print("error while waiting for journal!")
|
||||||
|
}
|
||||||
for {
|
for {
|
||||||
m, c, err := e.journal.NextMessage()
|
m, c, err := e.journal.NextMessage()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user