Skip to content

Commit

Permalink
fix: delay snapshots temporarily (#391)
Browse files Browse the repository at this point in the history
  • Loading branch information
chingor13 committed Apr 2, 2020
1 parent e28eb59 commit 77ba820
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/release-pr.ts
Expand Up @@ -103,7 +103,26 @@ export class ReleasePR {
this.gh = this.gitHubInstance(options.octokitAPIs);
}

async delay({ms = 3000}) {
new Promise((resolve, reject) => {
setTimeout(() => {
return resolve();
}, ms);
});
}

async run() {
// TODO: this temporarily resolves a race condition between creating a release
// and updating tags on the release PR. This should be replaced by a queuing
// mechanism to delay/retry this request.
if (this.snapshot) {
checkpoint(
'snapshot: sleeping for 10 seconds...',
CheckpointType.Success
);
await this.delay({ms: 10000});
checkpoint('snapshot: finished sleeping', CheckpointType.Success);
}
const pr: GitHubReleasePR | undefined = await this.gh.findMergedReleasePR(
this.labels
);
Expand Down

0 comments on commit 77ba820

Please sign in to comment.