Skip to content

Commit

Permalink
[gha cache] delete on success only (#782)
Browse files Browse the repository at this point in the history
Otherwise, GHA Runners can get 404 on a retry
  • Loading branch information
fkorotkov committed Sep 3, 2024
1 parent fc80340 commit 43413dd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/agent/http_cache/ghacache/ghacache.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ func (cache *GHACache) commitUploadable(writer http.ResponseWriter, request *htt

return
}
defer cache.uploadables.Delete(id)

var jsonReq struct {
Size int64 `json:"size"`
Expand Down Expand Up @@ -284,6 +283,9 @@ func (cache *GHACache) commitUploadable(writer http.ResponseWriter, request *htt
return
}

// Delete uploadable only on success. GHA Runner can retry in case of a failure.
cache.uploadables.Delete(id)

writer.WriteHeader(http.StatusCreated)
}

Expand Down

0 comments on commit 43413dd

Please sign in to comment.