mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-27 06:49:07 +01:00
log wt version
This commit is contained in:
@@ -270,15 +270,21 @@ func (p *Peer) UpdateMetaIfNew(meta PeerSystemMeta) (updated, versionChanged boo
|
|||||||
meta.UIVersion = p.Meta.UIVersion
|
meta.UIVersion = p.Meta.UIVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
oldVersion := p.Meta.WtVersion
|
||||||
|
|
||||||
diff := metaDiff(p.Meta, meta)
|
diff := metaDiff(p.Meta, meta)
|
||||||
if len(diff) == 0 {
|
if len(diff) != 0 {
|
||||||
return updated, versionChanged
|
p.Meta = meta
|
||||||
|
updated = true
|
||||||
|
}
|
||||||
|
|
||||||
|
versionInfo := ""
|
||||||
|
if versionChanged {
|
||||||
|
versionInfo = fmt.Sprintf("version changed: %s -> %s, ", oldVersion, meta.WtVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
p.Meta = meta
|
|
||||||
updated = true
|
|
||||||
log.WithFields(log.Fields{"peer": p.ID, "key": p.Key}).
|
log.WithFields(log.Fields{"peer": p.ID, "key": p.Key}).
|
||||||
Debugf("peer meta updated, %d field(s) changed: %s", len(diff), strings.Join(diff, ", "))
|
Debugf("peer meta updated, %s%d field(s) changed: %s", versionInfo, len(diff), strings.Join(diff, ", "))
|
||||||
return updated, versionChanged
|
return updated, versionChanged
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user