Skip to content

Commit dd1d380

Browse files
committed
Fix ctx issue
1 parent f3ff52e commit dd1d380

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

coderd/gitsshkey.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func (api *API) gitSSHKey(rw http.ResponseWriter, r *http.Request) {
126126
func (api *API) agentGitSSHKey(rw http.ResponseWriter, r *http.Request) {
127127
ctx := r.Context()
128128
agent := httpmw.WorkspaceAgent(r)
129-
resource, err := api.Database.GetWorkspaceResourceByID(agentCtx, agent.ResourceID)
129+
resource, err := api.Database.GetWorkspaceResourceByID(ctx, agent.ResourceID)
130130
if err != nil {
131131
httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
132132
Message: "Internal error fetching workspace resource.",
@@ -135,7 +135,7 @@ func (api *API) agentGitSSHKey(rw http.ResponseWriter, r *http.Request) {
135135
return
136136
}
137137

138-
job, err := api.Database.GetWorkspaceBuildByJobID(agentCtx, resource.JobID)
138+
job, err := api.Database.GetWorkspaceBuildByJobID(ctx, resource.JobID)
139139
if err != nil {
140140
httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
141141
Message: "Internal error fetching workspace build.",
@@ -144,7 +144,7 @@ func (api *API) agentGitSSHKey(rw http.ResponseWriter, r *http.Request) {
144144
return
145145
}
146146

147-
workspace, err := api.Database.GetWorkspaceByID(agentCtx, job.WorkspaceID)
147+
workspace, err := api.Database.GetWorkspaceByID(ctx, job.WorkspaceID)
148148
if err != nil {
149149
httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
150150
Message: "Internal error fetching workspace.",
@@ -153,7 +153,7 @@ func (api *API) agentGitSSHKey(rw http.ResponseWriter, r *http.Request) {
153153
return
154154
}
155155

156-
gitSSHKey, err := api.Database.GetGitSSHKey(agentCtx, workspace.OwnerID)
156+
gitSSHKey, err := api.Database.GetGitSSHKey(ctx, workspace.OwnerID)
157157
if err != nil {
158158
httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
159159
Message: "Internal error fetching git SSH key.",

0 commit comments

Comments
 (0)