remove semaphore and fix push metrics

This commit is contained in:
Pascal Fischer
2025-10-08 21:03:15 +02:00
parent 26f5aee4b9
commit fc2f23bd22
2 changed files with 3 additions and 7 deletions

View File

@@ -26,13 +26,14 @@ func (b *UpdateBuffer) Push(update *UpdateMessage) {
defer b.mu.Unlock()
if b.update == nil || update.Update.NetworkMap.Serial > b.update.Update.NetworkMap.Serial || b.update.Update.NetworkMap.Serial == 0 {
b.update = update
b.cond.Signal()
if b.update == nil {
b.metrics.CountBufferPush()
return
}
b.update = update
b.cond.Signal()
b.metrics.CountBufferOverwrite()
return
}