mirror of
https://github.com/immich-app/immich.git
synced 2025-05-24 01:12:58 -04:00
fix: MAX_PARAMETERS_EXCEEDED error during person cleanup job (#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 <“hwang.iit@gmail.com”> Co-authored-by: Zack Pollard <zackpollard@ymail.com>
This commit is contained in:
parent
09f4476f97
commit
a831876fdc
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user