Skip to content

Commit e09b21f

Browse files
committed
add config upsert timeout env var
1 parent e17331a commit e09b21f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/backend/src/connectionManager.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { createLogger } from "./logger.js";
66
import os from 'os';
77
import { Redis } from 'ioredis';
88
import { RepoData, compileGithubConfig, compileGitlabConfig, compileGiteaConfig, compileGerritConfig } from "./repoCompileUtils.js";
9+
import { CONFIG_REPO_UPSERT_TIMEOUT_MS } from "./environment.js";
910

1011
interface IConnectionManager {
1112
scheduleConnectionSync: (connection: Connection) => Promise<void>;
@@ -136,7 +137,7 @@ export class ConnectionManager implements IConnectionManager {
136137
});
137138
}));
138139

139-
});
140+
}, { timeout: parseInt(CONFIG_REPO_UPSERT_TIMEOUT_MS) });
140141
}
141142

142143

packages/backend/src/environment.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,6 @@ export const FALLBACK_GITHUB_TOKEN = getEnv(process.env.FALLBACK_GITHUB_TOKEN);
3535
export const FALLBACK_GITLAB_TOKEN = getEnv(process.env.FALLBACK_GITLAB_TOKEN);
3636
export const FALLBACK_GITEA_TOKEN = getEnv(process.env.FALLBACK_GITEA_TOKEN);
3737

38+
export const CONFIG_REPO_UPSERT_TIMEOUT_MS = getEnv(process.env.CONFIG_REPO_UPSERT_TIMEOUT_MS, '15000')!;
39+
3840
export const INDEX_CONCURRENCY_MULTIPLE = getEnv(process.env.INDEX_CONCURRENCY_MULTIPLE);

0 commit comments

Comments
 (0)