MCPcopy Index your code
hub / github.com/coder/coder / handleRegister

Method handleRegister

enterprise/wsproxy/wsproxy.go:502–512  ·  view source on GitHub ↗
(res wsproxysdk.RegisterWorkspaceProxyResponse)

Source from the content-addressed store, hash-verified

500}
501
502func (s *Server) handleRegister(res wsproxysdk.RegisterWorkspaceProxyResponse) error {
503 addresses := make([]string, len(res.SiblingReplicas))
504 for i, replica := range res.SiblingReplicas {
505 addresses[i] = replica.RelayAddress
506 }
507 s.Logger.Debug(s.ctx, "setting DERP mesh sibling addresses", slog.F("addresses", addresses))
508 s.derpMesh.SetAddresses(addresses, false)
509
510 go s.pingSiblingReplicas(res.SiblingReplicas)
511 return nil
512}
513
514func (s *Server) pingSiblingReplicas(replicas []codersdk.Replica) {
515 ctx, cancel := context.WithTimeout(s.ctx, 10*time.Second)

Callers 1

NewFunction · 0.95

Calls 2

pingSiblingReplicasMethod · 0.95
SetAddressesMethod · 0.45

Tested by

no test coverage detected