mirror of
https://github.com/matrix-org/matrix-hookshot.git
synced 2025-03-10 21:19:13 +00:00
Move validity check
This commit is contained in:
parent
5507c89188
commit
73b2bf77ab
@ -102,11 +102,6 @@ export class Bridge {
|
||||
public async start() {
|
||||
log.info('Starting up');
|
||||
|
||||
if (!this.config.github && !this.config.gitlab && !this.config.jira && !this.config.generic) {
|
||||
log.error("You haven't configured support for GitHub or GitLab!");
|
||||
throw Error('Bridge cannot start -- no connectors are configured');
|
||||
}
|
||||
|
||||
if (this.config.github) {
|
||||
this.github = new GithubInstance(this.config.github.auth.id, await fs.readFile(this.config.github.auth.privateKeyFile, 'utf-8'));
|
||||
await this.github.start();
|
||||
|
@ -218,6 +218,12 @@ export class BridgeConfig {
|
||||
this.logging = configData.logging || {
|
||||
level: "info",
|
||||
}
|
||||
|
||||
|
||||
if (!this.github && !this.gitlab && !this.jira && !this.generic) {
|
||||
throw Error("Config is not valid: At least one of GitHub, GitLab, JIRA or generic hooks must be configured");
|
||||
}
|
||||
|
||||
// TODO: Formalize env support
|
||||
if (env.CFG_QUEUE_MONOLITHIC && ["false", "off", "no"].includes(env.CFG_QUEUE_MONOLITHIC)) {
|
||||
this.queue.monolithic = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user