Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions coderd/agentapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ type Options struct {
WorkspaceID uuid.UUID
OrganizationID uuid.UUID

Ctx context.Context
AuthenticatedCtx context.Context
Log slog.Logger
Clock quartz.Clock
Database database.Store
Expand Down Expand Up @@ -220,7 +220,7 @@ func New(opts Options, workspace database.Workspace) *API {

// Start background cache refresh loop to handle workspace changes
// like prebuild claims where owner_id and other fields may be modified in the DB.
go api.startCacheRefreshLoop(opts.Ctx)
go api.startCacheRefreshLoop(opts.AuthenticatedCtx)

return api
}
Expand Down
18 changes: 9 additions & 9 deletions coderd/agentapi/metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -671,15 +671,15 @@ func TestBatchUpdateMetadata(t *testing.T) {

// Create full API with cached workspace fields (initial state)
api := agentapi.New(agentapi.Options{
Ctx: ctxWithActor,
AgentID: agentID,
WorkspaceID: workspaceID,
OwnerID: ownerID,
OrganizationID: orgID,
Database: dbauthz.New(dbM, auth, testutil.Logger(t), accessControlStore),
Log: testutil.Logger(t),
Clock: mClock,
Pubsub: pub,
AuthenticatedCtx: ctxWithActor,
AgentID: agentID,
WorkspaceID: workspaceID,
OwnerID: ownerID,
OrganizationID: orgID,
Database: dbauthz.New(dbM, auth, testutil.Logger(t), accessControlStore),
Log: testutil.Logger(t),
Clock: mClock,
Pubsub: pub,
}, initialWorkspace) // Cache is initialized with 9am schedule and "my-workspace" name

// Wait for ticker to be set up and release it so it can fire
Expand Down
2 changes: 1 addition & 1 deletion coderd/workspaceagentsrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (api *API) workspaceAgentRPC(rw http.ResponseWriter, r *http.Request) {
WorkspaceID: workspace.ID,
OrganizationID: workspace.OrganizationID,

Ctx: api.ctx,
AuthenticatedCtx: ctx,
Log: logger,
Clock: api.Clock,
Database: api.Database,
Expand Down
Loading