MCPcopy Create free account
hub / github.com/coder/coder / InRegion

Method InRegion

enterprise/replicasync/replicasync.go:418–429  ·  view source on GitHub ↗

InRegion returns every replica in the given DERP region excluding itself.

(regionID int32)

Source from the content-addressed store, hash-verified

416
417// InRegion returns every replica in the given DERP region excluding itself.
418func (m *Manager) InRegion(regionID int32) []database.Replica {
419 m.mutex.Lock()
420 defer m.mutex.Unlock()
421 replicas := make([]database.Replica, 0)
422 for _, replica := range m.peers {
423 if replica.RegionID != regionID {
424 continue
425 }
426 replicas = append(replicas, replica)
427 }
428 return replicas
429}
430
431// Regional returns all replicas in the same region excluding itself.
432func (m *Manager) Regional() []database.Replica {

Callers 2

RegionalMethod · 0.95

Calls 2

LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected