mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
fix: Simplify provisionerd job acquire (#158)
This uses a simple channel to detect whether a job is running or not, and moves all cancels to be in goroutines.
This commit is contained in:
@ -82,6 +82,10 @@ func (api *api) postWorkspaceHistoryByUser(rw http.ResponseWriter, r *http.Reque
|
||||
Message: fmt.Sprintf("The provided project history %q has failed to import. You cannot create workspaces using it!", projectHistory.Name),
|
||||
})
|
||||
return
|
||||
case ProvisionerJobStatusCancelled:
|
||||
httpapi.Write(rw, http.StatusPreconditionFailed, httpapi.Response{
|
||||
Message: "The provided project history was canceled during import. You cannot create workspaces using it!",
|
||||
})
|
||||
}
|
||||
|
||||
project, err := api.Database.GetProjectByID(r.Context(), projectHistory.ProjectID)
|
||||
|
Reference in New Issue
Block a user