fix: Retry if there is no git auth user yet (#5316)

Fixes part of #4900.
This commit is contained in:
Kyle Carberry
2022-12-06 09:06:41 -06:00
committed by GitHub
parent b2dc60c030
commit c77c1b4bc2

View File

@ -1154,6 +1154,9 @@ func (api *API) workspaceAgentsGitAuth(rw http.ResponseWriter, r *http.Request)
UserID: workspace.OwnerID,
})
if err != nil {
if errors.Is(err, sql.ErrNoRows) {
continue
}
httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
Message: "Failed to get git auth link.",
Detail: err.Error(),