Guys.

I have one question about database connection in nestjs.

I used typeorm to connect postgres database as below.

TypeOrmModule.forRootAsync({
  imports: [ConfigServiceModule],
  useFactory: (configService: ConfigService) => ({
    ...configService.postgresInitConfig(),
    type: "postgres",
    timezone: "+0",
    entities: ["domain/entities/*.ts", "./dist/app/domain/entities/*.js"],
    synchronize: false,
    namingStrategy: new TypeOrmNamingStrategy(),
  }),
  inject: [ConfigService],
}),
TypeOrmModule.forFeature(entities.entityClass),

and then I realized nestjs is re-connecting automatically

although database server is rebooting.

(Isn’t typeormModule only executed once when an application is launched?)

Where can I find the source code for automatic connection?