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

Method SyncReady

agent/agentsocket/service.go:119–133  ·  view source on GitHub ↗

SyncReady checks whether a unit is ready to be started. That is, all dependencies are satisfied.

(_ context.Context, req *proto.SyncReadyRequest)

Source from the content-addressed store, hash-verified

117
118// SyncReady checks whether a unit is ready to be started. That is, all dependencies are satisfied.
119func (s *DRPCAgentSocketService) SyncReady(_ context.Context, req *proto.SyncReadyRequest) (*proto.SyncReadyResponse, error) {
120 if s.unitManager == nil {
121 return nil, xerrors.Errorf("cannot check readiness: %w", ErrUnitManagerNotAvailable)
122 }
123
124 unitID := unit.ID(req.Unit)
125 isReady, err := s.unitManager.IsReady(unitID)
126 if err != nil {
127 return nil, xerrors.Errorf("cannot check readiness: %w", err)
128 }
129
130 return &proto.SyncReadyResponse{
131 Ready: isReady,
132 }, nil
133}
134
135// SyncStatus gets the status of a unit and lists its dependencies.
136func (s *DRPCAgentSocketService) SyncStatus(_ context.Context, req *proto.SyncStatusRequest) (*proto.SyncStatusResponse, error) {

Callers

nothing calls this directly

Calls 3

IDTypeAlias · 0.92
IsReadyMethod · 0.80
ErrorfMethod · 0.45

Tested by

no test coverage detected