Skip to content

Commit 67a51f4

Browse files
hwang3419hwang3419zackpollard
authored andcommitted
fix: MAX_PARAMETERS_EXCEEDED error during person cleanup job (immich-app#17222)
* add batch size in sql delete,fix person cleanup error: ERROR [Microservices:{}] Unable to run job handler (backgroundTask/person-cleanup): Error: MAX_PARAMETERS_EXCEEDED: Max number of parameters (65534) exceeded * add chunked decorator to delete * chore: prettier formatting fixes --------- Co-authored-by: hwang3419 <“[email protected]”> Co-authored-by: Zack Pollard <[email protected]>
1 parent 754f675 commit 67a51f4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/src/services/person.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { BadRequestException, Injectable, NotFoundException } from '@nestjs/common';
22
import { FACE_THUMBNAIL_SIZE, JOBS_ASSET_PAGINATION_SIZE } from 'src/constants';
33
import { StorageCore } from 'src/cores/storage.core';
4-
import { OnJob } from 'src/decorators';
4+
import { Chunked, OnJob } from 'src/decorators';
55
import { BulkIdErrorReason, BulkIdResponseDto } from 'src/dtos/asset-ids.response.dto';
66
import { AuthDto } from 'src/dtos/auth.dto';
77
import {
@@ -241,6 +241,7 @@ export class PersonService extends BaseService {
241241
return results;
242242
}
243243

244+
@Chunked()
244245
private async delete(people: PersonEntity[]) {
245246
await Promise.all(people.map((person) => this.storageRepository.unlink(person.thumbnailPath)));
246247
await this.personRepository.delete(people);

0 commit comments

Comments
 (0)