SyncComplete marks a unit as complete in the dependency graph.
(_ context.Context, req *proto.SyncCompleteRequest)
| 102 | |
| 103 | // SyncComplete marks a unit as complete in the dependency graph. |
| 104 | func (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. |
| 119 | func (s *DRPCAgentSocketService) SyncReady(_ context.Context, req *proto.SyncReadyRequest) (*proto.SyncReadyResponse, error) { |
nothing calls this directly
no test coverage detected