chore: use mutex around `blockEndpoints` (#8209)

https://github.com/coder/coder/actions/runs/5378950122/jobs/9759972142
This commit is contained in:
Kyle Carberry 2023-06-26 10:01:50 -05:00 committed by GitHub
parent 4539ce7db6
commit f40865bc2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -709,9 +709,11 @@ func (c *Conn) selfNode() *Node {
DERPLatency: derpLatency,
DERPForcedWebsocket: derpForcedWebsocket,
}
c.mutex.Lock()
if c.blockEndpoints {
node.Endpoints = nil
}
c.mutex.Unlock()
return node
}