mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-18 17:14:20 +01:00
Set maximum open simulator-created issues
This commit is contained in:
@@ -25,6 +25,8 @@ type FaultTimeout = {
|
||||
|
||||
type Fault = FaultPanic | FaultTimeout | FaultAssertion;
|
||||
|
||||
const MAX_OPEN_SIMULATOR_ISSUES = parseInt(process.env.MAX_OPEN_SIMULATOR_ISSUES || "10", 10);
|
||||
|
||||
export class GithubClient {
|
||||
/* This is the git hash of the commit that the simulator was built from. */
|
||||
GIT_HASH: string;
|
||||
@@ -106,6 +108,12 @@ export class GithubClient {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.openIssueTitles.length >= MAX_OPEN_SIMULATOR_ISSUES) {
|
||||
console.log(`Max open simulator issues reached: ${MAX_OPEN_SIMULATOR_ISSUES}`);
|
||||
console.log(`Would create issue in ${this.GITHUB_REPO} with title: ${title} and body: ${body}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const [owner, repo] = this.GITHUB_REPO.split('/');
|
||||
|
||||
const octokit = await this.app!.getInstallationOctokit(this.GITHUB_APP_INSTALLATION_ID);
|
||||
|
||||
Reference in New Issue
Block a user