mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-08-23 01:27:13 +02:00
internal/clientinfo: use ptr cache when listing clients
This commit is contained in:
@@ -40,6 +40,13 @@ func (p *ptrDiscover) String() string {
|
||||
return "ptr"
|
||||
}
|
||||
|
||||
func (p *ptrDiscover) lookupHostnameFromCache(ip string) string {
|
||||
if val, ok := p.hostname.Load(ip); ok {
|
||||
return val.(string)
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (p *ptrDiscover) lookupHostname(ip string) string {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
|
||||
defer cancel()
|
||||
|
||||
Reference in New Issue
Block a user