mpool/repub: only record in journal if actually repubbing.

This commit is contained in:
Raúl Kripalani 2020-08-11 15:06:13 +01:00
parent 8f19fff1ec
commit 200b0f72cc

View File

@ -371,6 +371,7 @@ func (mp *MessagePool) runLoop() {
log.Errorf("errors while republishing: %+v", errout)
}
if len(outputMsgs) > 0 {
journal.MaybeRecordEvent(mp.jrnl, mp.evtTypes[evtTypeMpoolRepub], func() interface{} {
msgs := make([]MessagePoolEvt_Message, 0, len(outputMsgs))
for _, m := range outputMsgs {
@ -382,6 +383,7 @@ func (mp *MessagePool) runLoop() {
Error: errout,
}
})
}
case <-mp.pruneTrigger:
if err := mp.pruneExcessMessages(); err != nil {