Fix getting updated tables immediately
This commit is contained in:
@@ -25,12 +25,12 @@ type Info struct {
|
||||
func GetInfo() *Info {
|
||||
info := &Info{}
|
||||
|
||||
info.TCP4Connections, info.TCP4Listeners, _ = tcp4Table.updateTables(0)
|
||||
info.UDP4Binds, _ = udp4Table.updateTables(0)
|
||||
info.TCP4Connections, info.TCP4Listeners, _ = tcp4Table.updateTables(tcp4Table.updateIter.Load())
|
||||
info.UDP4Binds, _ = udp4Table.updateTables(udp4Table.updateIter.Load())
|
||||
|
||||
if netenv.IPv6Enabled() {
|
||||
info.TCP6Connections, info.TCP6Listeners, _ = tcp6Table.updateTables(tcp6Table.updateIter.Load())
|
||||
info.UDP6Binds, _ = udp6Table.updateTables(0)
|
||||
info.UDP6Binds, _ = udp6Table.updateTables(udp6Table.updateIter.Load())
|
||||
}
|
||||
|
||||
info.UpdateMeta()
|
||||
|
||||
@@ -168,11 +168,11 @@ func (table *udpTable) updateTables(previousUpdateIter uint64) (
|
||||
func CleanUDPStates(_ context.Context) {
|
||||
now := time.Now().UTC()
|
||||
|
||||
udp4Table.updateTables(0)
|
||||
udp4Table.updateTables(udp4Table.updateIter.Load())
|
||||
udp4Table.cleanStates(now)
|
||||
|
||||
if netenv.IPv6Enabled() {
|
||||
udp6Table.updateTables(0)
|
||||
udp6Table.updateTables(udp6Table.updateIter.Load())
|
||||
udp6Table.cleanStates(now)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user