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

Method SyncComplete

agent/agentsocket/service.go:104–116  ·  view source on GitHub ↗

SyncComplete marks a unit as complete in the dependency graph.

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

Source from the content-addressed store, hash-verified

102
103// SyncComplete marks a unit as complete in the dependency graph.
104func (s *DRPCAgentSocketService) SyncComplete(_ context.Context, req *proto.SyncCompleteRequest) (*proto.SyncCompleteResponse, error) {
105 if s.unitManager == nil {
106 return nil, xerrors.Errorf("cannot complete unit: %w", ErrUnitManagerNotAvailable)
107 }
108
109 unitID := unit.ID(req.Unit)
110
111 if err := s.unitManager.UpdateStatus(unitID, unit.StatusComplete); err != nil {
112 return nil, xerrors.Errorf("cannot complete unit %q: %w", req.Unit, err)
113 }
114
115 return &proto.SyncCompleteResponse{}, nil
116}
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) {

Callers

nothing calls this directly

Calls 3

IDTypeAlias · 0.92
UpdateStatusMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected