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

Method AllPrimary

enterprise/replicasync/replicasync.go:403–415  ·  view source on GitHub ↗

AllPrimary returns every primary replica (not workspace proxy replicas), including itself.

()

Source from the content-addressed store, hash-verified

401// AllPrimary returns every primary replica (not workspace proxy replicas),
402// including itself.
403func (m *Manager) AllPrimary() []database.Replica {
404 m.mutex.Lock()
405 defer m.mutex.Unlock()
406 replicas := make([]database.Replica, 0, len(m.peers))
407 for _, replica := range append(m.peers, m.self) {
408 if !replica.Primary {
409 continue
410 }
411
412 replicas = append(replicas, replica)
413 }
414 return replicas
415}
416
417// InRegion returns every replica in the given DERP region excluding itself.
418func (m *Manager) InRegion(regionID int32) []database.Replica {

Callers 4

NewFunction · 0.80
updateEntitlementsMethod · 0.80
replicasMethod · 0.80
TestReplicaFunction · 0.80

Calls 2

LockMethod · 0.45
UnlockMethod · 0.45

Tested by 1

TestReplicaFunction · 0.64