mirror of
https://github.com/immich-app/immich.git
synced 2024-12-28 06:31:58 +00:00
set exiftool maxProcs
This commit is contained in:
parent
03dffc8414
commit
ba10bf7628
3 changed files with 15 additions and 0 deletions
|
@ -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>;
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
|
||||
|
|
Loading…
Reference in a new issue