mirror of
https://github.com/immich-app/immich.git
synced 2024-12-29 15:11: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 {
|
export interface IMetadataRepository {
|
||||||
|
setMaxConcurrency(concurrency: number): void;
|
||||||
teardown(): Promise<void>;
|
teardown(): Promise<void>;
|
||||||
readTags(path: string): Promise<ImmichTags>;
|
readTags(path: string): Promise<ImmichTags>;
|
||||||
writeTags(path: string, tags: Partial<Tags>): Promise<void>;
|
writeTags(path: string, tags: Partial<Tags>): Promise<void>;
|
||||||
|
|
|
@ -24,6 +24,10 @@ export class MetadataRepository implements IMetadataRepository {
|
||||||
this.logger.setContext(MetadataRepository.name);
|
this.logger.setContext(MetadataRepository.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setMaxConcurrency(concurrency: number) {
|
||||||
|
this.exiftool.batchCluster.setMaxProcs(concurrency);
|
||||||
|
}
|
||||||
|
|
||||||
async teardown() {
|
async teardown() {
|
||||||
await this.exiftool.end();
|
await this.exiftool.end();
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,6 +80,16 @@ export class MetadataService extends BaseService {
|
||||||
await this.metadataRepository.teardown();
|
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() {
|
private async init() {
|
||||||
this.logger.log('Initializing metadata service');
|
this.logger.log('Initializing metadata service');
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue