mirror of
https://github.com/ToolJet/ToolJet
synced 2026-04-21 21:47:17 +00:00
19 lines
701 B
TypeScript
19 lines
701 B
TypeScript
import { AppModule } from '@modules/app/module';
|
|
import { SampleDataSourceService } from '@modules/data-sources/services/sample-ds.service';
|
|
import { NestFactory } from '@nestjs/core';
|
|
|
|
async function sampleDbConfigReset() {
|
|
const app = await NestFactory.create(await AppModule.register({ IS_GET_CONTEXT: true }), {
|
|
logger: ['error', 'warn'],
|
|
});
|
|
const dataSourceService = app.get(SampleDataSourceService);
|
|
|
|
await dataSourceService.updateSampleDs();
|
|
await app.close();
|
|
// TODO: process exit wasn't needed earlier
|
|
// need to debug why app.close() doesn't exit gracefully
|
|
process.exit(0);
|
|
}
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
sampleDbConfigReset();
|