fix(server): runtime config overrides won't affect static startup (#7110)

This commit is contained in:
forehalo
2024-05-30 09:11:34 +00:00
parent d7ced4a5d9
commit 622239fd41
2 changed files with 3 additions and 15 deletions
+1 -15
View File
@@ -1,25 +1,11 @@
import { Module } from '@nestjs/common';
import { AppModule as BusinessAppModule } from '../app.module';
import { ConfigModule } from '../fundamentals/config';
import { CreateCommand, NameQuestion } from './commands/create';
import { RevertCommand, RunCommand } from './commands/run';
@Module({
imports: [
ConfigModule.forRoot({
doc: {
manager: {
enableUpdateAutoMerging: false,
},
},
metrics: {
enabled: false,
customerIo: {},
},
}),
BusinessAppModule,
],
imports: [BusinessAppModule],
providers: [NameQuestion, CreateCommand, RunCommand, RevertCommand],
})
export class CliAppModule {}
@@ -4,6 +4,8 @@ import { Logger } from '@nestjs/common';
import { CommandFactory } from 'nest-commander';
async function bootstrap() {
AFFiNE.metrics.enabled = false;
AFFiNE.doc.manager.enableUpdateAutoMerging = false;
const { CliAppModule } = await import('./app');
await CommandFactory.run(CliAppModule, new Logger()).catch(e => {
console.error(e);