Skip to content

High performance self-hosted photo and video management solution.

fix: MAX_PARAMETERS_EXCEEDED error during person cleanup job (#17222)

hwanga831876fdcd0
diff --git a/server/src/services/person.service.ts b/server/src/services/person.service.ts
index c6c3ce4e4f..65a4508a3b 100644
--- a/server/src/services/person.service.ts
+++ b/server/src/services/person.service.ts
@@ -1,7 +1,7 @@
import { BadRequestException, Injectable, NotFoundException } from '@nestjs/common';
import { FACE_THUMBNAIL_SIZE, JOBS_ASSET_PAGINATION_SIZE } from 'src/constants';
import { StorageCore } from 'src/cores/storage.core';
-import { OnJob } from 'src/decorators';
+import { Chunked, OnJob } from 'src/decorators';
import { BulkIdErrorReason, BulkIdResponseDto } from 'src/dtos/asset-ids.response.dto';
import { AuthDto } from 'src/dtos/auth.dto';
import {
@@ -241,6 +241,7 @@ export class PersonService extends BaseService {
return results;
}
+ @Chunked()
private async delete(people: PersonEntity[]) {
await Promise.all(people.map((person) => this.storageRepository.unlink(person.thumbnailPath)));
await this.personRepository.delete(people);