mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-20 09:16:40 +00:00
remove semaphore and fix push metrics
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user