(ctx context.Context)
| 290 | } |
| 291 | |
| 292 | func (a *API) agent(ctx context.Context) (database.WorkspaceAgent, error) { |
| 293 | agent, err := a.opts.Database.GetWorkspaceAgentByID(ctx, a.opts.AgentID) |
| 294 | if err != nil { |
| 295 | return database.WorkspaceAgent{}, xerrors.Errorf("get workspace agent by id %q: %w", a.opts.AgentID, err) |
| 296 | } |
| 297 | return agent, nil |
| 298 | } |
| 299 | |
| 300 | // refreshCachedWorkspace periodically updates the cached workspace fields. |
| 301 | // This ensures that changes like prebuild claims (which modify owner_id, name, etc.) |
nothing calls this directly
no test coverage detected