Skip to content

Commit

Permalink
core-103 break from retrying if we get a 422
Browse files Browse the repository at this point in the history
  • Loading branch information
SorchaAbel authored and DrJosh9000 committed Mar 27, 2024
1 parent 2a8f473 commit d0930e1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion agent/artifact_batch_creator.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ func (a *ArtifactBatchCreator) Create(ctx context.Context) ([]*api.Artifact, err
}

creation, resp, err := a.apiClient.CreateArtifacts(ctxTimeout, a.conf.JobID, batch)
if resp != nil && (resp.StatusCode == 401 || resp.StatusCode == 404) {
// the server returns a 403 code if the artifact has exceeded the service quota
if resp != nil && (resp.StatusCode == 401 || resp.StatusCode == 403 || resp.StatusCode == 404) {
a.logger.Warn("Artifact creation failed with status code %d, breaking the retry loop", resp.StatusCode)
r.Break()
}
if err != nil {
Expand Down

0 comments on commit d0930e1

Please sign in to comment.