1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-25 10:43:13 +02:00

set exiftool maxProcs

This commit is contained in:
mertalev 2024-11-21 01:44:21 -05:00
parent 03dffc8414
commit ba10bf7628
No known key found for this signature in database
GPG Key ID: 3A2B5BFC678DBC80
3 changed files with 15 additions and 0 deletions

View File

@ -64,6 +64,7 @@ export interface ImmichTags extends Omit<Tags, TagsWithWrongTypes> {
}
export interface IMetadataRepository {
setMaxConcurrency(concurrency: number): void;
teardown(): Promise<void>;
readTags(path: string): Promise<ImmichTags>;
writeTags(path: string, tags: Partial<Tags>): Promise<void>;

View File

@ -24,6 +24,10 @@ export class MetadataRepository implements IMetadataRepository {
this.logger.setContext(MetadataRepository.name);
}
setMaxConcurrency(concurrency: number) {
this.exiftool.batchCluster.setMaxProcs(concurrency);
}
async teardown() {
await this.exiftool.end();
}

View File

@ -80,6 +80,16 @@ export class MetadataService extends BaseService {
await this.metadataRepository.teardown();
}
@OnEvent({ name: 'config.init', workers: [ImmichWorker.MICROSERVICES] })
onConfigInit({ newConfig }: ArgOf<'config.init'>) {
this.metadataRepository.setMaxConcurrency(newConfig.job.metadataExtraction.concurrency);
}
@OnEvent({ name: 'config.update', workers: [ImmichWorker.MICROSERVICES], server: true })
onConfigUpdate({ newConfig }: ArgOf<'config.update'>) {
this.metadataRepository.setMaxConcurrency(newConfig.job.metadataExtraction.concurrency);
}
private async init() {
this.logger.log('Initializing metadata service');