(ctx context.Context)
| 157 | } |
| 158 | |
| 159 | func (h *Handler) getEngineType(ctx context.Context) storepb.Engine { |
| 160 | instanceID := h.getInstanceID() |
| 161 | if instanceID == "" { |
| 162 | return storepb.Engine_ENGINE_UNSPECIFIED |
| 163 | } |
| 164 | |
| 165 | instance, err := h.store.GetInstance(ctx, &store.FindInstanceMessage{ |
| 166 | Workspace: common.GetWorkspaceIDFromContext(ctx), |
| 167 | ResourceID: &instanceID, |
| 168 | }) |
| 169 | if err != nil { |
| 170 | slog.Error("Failed to get instance", log.BBError(err)) |
| 171 | return storepb.Engine_ENGINE_UNSPECIFIED |
| 172 | } |
| 173 | if instance == nil { |
| 174 | slog.Error("Instance not found", slog.String("instanceID", instanceID)) |
| 175 | return storepb.Engine_ENGINE_UNSPECIFIED |
| 176 | } |
| 177 | return instance.Metadata.GetEngine() |
| 178 | } |
| 179 | |
| 180 | func (h *Handler) checkInitialized(req *jsonrpc2.Request) error { |
| 181 | h.mu.Lock() |
no test coverage detected