Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: prevent infinite looping of overwriteArtifact
Browse files Browse the repository at this point in the history
CCInc authored Jun 23, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 4e90504 commit fc80d85
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/electron-publish/src/gitHubPublisher.ts
Original file line number Diff line number Diff line change
@@ -198,12 +198,10 @@ export class GitHubPublisher extends HttpPublisher {
requestProcessor
)
.catch(e => {
if (this.doesErrorMeanAlreadyExists(e)) {
return this.overwriteArtifact(fileName, release).then(() => this.doUploadFile(attemptNumber, parsedUrl, fileName, dataLength, requestProcessor, release))
}

if (attemptNumber > 3) {
return Promise.reject(e)
} else if (this.doesErrorMeanAlreadyExists(e)) {
return this.overwriteArtifact(fileName, release).then(() => this.doUploadFile(attemptNumber + 1, parsedUrl, fileName, dataLength, requestProcessor, release))
} else {
return new Promise((resolve, reject) => {
const newAttemptNumber = attemptNumber + 1

0 comments on commit fc80d85

Please sign in to comment.