mirror of
https://github.com/immich-app/immich
synced 2026-08-29 13:15:45 +00:00
chore: lint fixes for server
This commit is contained in:
parent
bc297f14c9
commit
2b659986c2
6 changed files with 12 additions and 7 deletions
|
|
@ -14,7 +14,7 @@ export class MaintenanceController {
|
|||
constructor(private service: MaintenanceService) {}
|
||||
|
||||
@Post('login')
|
||||
async maintenanceLogin(@Body() _dto: MaintenanceLoginDto): Promise<MaintenanceAuthDto> {
|
||||
maintenanceLogin(@Body() _dto: MaintenanceLoginDto): MaintenanceAuthDto {
|
||||
throw new BadRequestException('Not in maintenance mode');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,10 @@ export class MaintenanceAuthGuard implements CanActivate {
|
|||
|
||||
async canActivate(context: ExecutionContext): Promise<boolean> {
|
||||
const targets = [context.getHandler()];
|
||||
const options = this.reflector.getAllAndOverride<{} | undefined>(MetadataKey.AuthRoute, targets);
|
||||
const options = this.reflector.getAllAndOverride<{ _emptyObject: never } | undefined>(
|
||||
MetadataKey.AuthRoute,
|
||||
targets,
|
||||
);
|
||||
if (!options) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,13 +120,15 @@ export class MaintenanceWorkerRepository implements OnGatewayConnection, OnGatew
|
|||
}
|
||||
|
||||
private exitApp() {
|
||||
this.closeFn?.().then(() => process.exit(ExitCode.AppRestart));
|
||||
/* eslint-disable unicorn/no-process-exit */
|
||||
void this.closeFn?.().then(() => process.exit(ExitCode.AppRestart));
|
||||
|
||||
// in exceptional circumstance, the application may hang
|
||||
setTimeout(() => process.exit(ExitCode.AppRestart), 5000);
|
||||
/* eslint-enable unicorn/no-process-exit */
|
||||
}
|
||||
|
||||
async handleConnection(client: Socket) {
|
||||
handleConnection(client: Socket) {
|
||||
this.logger.log(`Websocket Connect: ${client.id}`);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ export class MaintenanceRepository {
|
|||
|
||||
exitApp() {
|
||||
/* eslint-disable unicorn/no-process-exit */
|
||||
this.closeFn?.().then(() => process.exit(ExitCode.AppRestart));
|
||||
void this.closeFn?.().then(() => process.exit(ExitCode.AppRestart));
|
||||
|
||||
// in exceptional circumstance, the application may hang
|
||||
setTimeout(() => process.exit(ExitCode.AppRestart), 5000);
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ async function bootstrap() {
|
|||
const app = await NestFactory.create<NestExpressApplication>(ApiModule, { bufferLogs: true });
|
||||
app.get(MaintenanceRepository).setCloseFn(() => app.close());
|
||||
|
||||
configureExpress(app);
|
||||
void configureExpress(app);
|
||||
}
|
||||
|
||||
bootstrap().catch((error) => {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ async function bootstrap() {
|
|||
const maintenanceWorkerRepository = app.get(MaintenanceWorkerRepository);
|
||||
maintenanceWorkerRepository.setCloseFn(() => app.close());
|
||||
|
||||
configureExpress(app, {
|
||||
void configureExpress(app, {
|
||||
permitSwaggerWrite: false,
|
||||
ssr: false,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue