mirror of
https://git.vectorsigma.ru/public/immich.git
synced 2026-08-01 10:48:33 +00:00
30 lines
997 B
TypeScript
30 lines
997 B
TypeScript
import { NestFactory } from '@nestjs/core';
|
|
import { NestExpressApplication } from '@nestjs/platform-express';
|
|
import { configureExpress, configureTelemetry } from 'src/app.common';
|
|
import { MaintenanceModule } from 'src/app.module';
|
|
import { MaintenanceWorkerService } from 'src/maintenance/maintenance-worker.service';
|
|
import { AppRepository } from 'src/repositories/app.repository';
|
|
import { isStartUpError } from 'src/utils/misc';
|
|
|
|
async function bootstrap() {
|
|
process.title = 'immich-maintenance';
|
|
configureTelemetry();
|
|
|
|
const app = await NestFactory.create<NestExpressApplication>(MaintenanceModule, { bufferLogs: true });
|
|
app.enableShutdownHooks();
|
|
app.get(AppRepository).setCloseFn(() => app.close());
|
|
|
|
void configureExpress(app, {
|
|
permitSwaggerWrite: false,
|
|
ssr: MaintenanceWorkerService,
|
|
});
|
|
}
|
|
|
|
bootstrap().catch((error) => {
|
|
if (!isStartUpError(error)) {
|
|
console.error(error);
|
|
}
|
|
// eslint-disable-next-line unicorn/no-process-exit
|
|
process.exit(1);
|
|
});
|