fix(server): runtime config overrides won't affect static startup (#7110)
This commit is contained in:
@@ -1,25 +1,11 @@
|
|||||||
import { Module } from '@nestjs/common';
|
import { Module } from '@nestjs/common';
|
||||||
|
|
||||||
import { AppModule as BusinessAppModule } from '../app.module';
|
import { AppModule as BusinessAppModule } from '../app.module';
|
||||||
import { ConfigModule } from '../fundamentals/config';
|
|
||||||
import { CreateCommand, NameQuestion } from './commands/create';
|
import { CreateCommand, NameQuestion } from './commands/create';
|
||||||
import { RevertCommand, RunCommand } from './commands/run';
|
import { RevertCommand, RunCommand } from './commands/run';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [BusinessAppModule],
|
||||||
ConfigModule.forRoot({
|
|
||||||
doc: {
|
|
||||||
manager: {
|
|
||||||
enableUpdateAutoMerging: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
metrics: {
|
|
||||||
enabled: false,
|
|
||||||
customerIo: {},
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
BusinessAppModule,
|
|
||||||
],
|
|
||||||
providers: [NameQuestion, CreateCommand, RunCommand, RevertCommand],
|
providers: [NameQuestion, CreateCommand, RunCommand, RevertCommand],
|
||||||
})
|
})
|
||||||
export class CliAppModule {}
|
export class CliAppModule {}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import { Logger } from '@nestjs/common';
|
|||||||
import { CommandFactory } from 'nest-commander';
|
import { CommandFactory } from 'nest-commander';
|
||||||
|
|
||||||
async function bootstrap() {
|
async function bootstrap() {
|
||||||
|
AFFiNE.metrics.enabled = false;
|
||||||
|
AFFiNE.doc.manager.enableUpdateAutoMerging = false;
|
||||||
const { CliAppModule } = await import('./app');
|
const { CliAppModule } = await import('./app');
|
||||||
await CommandFactory.run(CliAppModule, new Logger()).catch(e => {
|
await CommandFactory.run(CliAppModule, new Logger()).catch(e => {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
|||||||
Reference in New Issue
Block a user