mirror of
https://github.com/immich-app/immich.git
synced 2025-12-23 01:11:36 +03:00
feat(server): set exiftool process count (#16388)
exiftool concurrency control
This commit is contained in:
@@ -2,6 +2,7 @@ import { BinaryField, ExifDateTime } from 'exiftool-vendored';
|
||||
import { randomBytes } from 'node:crypto';
|
||||
import { Stats } from 'node:fs';
|
||||
import { constants } from 'node:fs/promises';
|
||||
import { defaults } from 'src/config';
|
||||
import { AssetEntity } from 'src/entities/asset.entity';
|
||||
import { ExifEntity } from 'src/entities/exif.entity';
|
||||
import { AssetType, ExifOrientation, ImmichWorker, JobName, JobStatus, SourceType } from 'src/enum';
|
||||
@@ -54,6 +55,27 @@ describe(MetadataService.name, () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('onConfigInit', () => {
|
||||
it('should update metadata processing concurrency', () => {
|
||||
sut.onConfigInit({ newConfig: defaults });
|
||||
|
||||
expect(mocks.metadata.setMaxConcurrency).toHaveBeenCalledWith(defaults.job.metadataExtraction.concurrency);
|
||||
expect(mocks.metadata.setMaxConcurrency).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('onConfigUpdate', () => {
|
||||
it('should update metadata processing concurrency', () => {
|
||||
const newConfig = structuredClone(defaults);
|
||||
newConfig.job.metadataExtraction.concurrency = 10;
|
||||
|
||||
sut.onConfigUpdate({ oldConfig: defaults, newConfig });
|
||||
|
||||
expect(mocks.metadata.setMaxConcurrency).toHaveBeenCalledWith(newConfig.job.metadataExtraction.concurrency);
|
||||
expect(mocks.metadata.setMaxConcurrency).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('handleLivePhotoLinking', () => {
|
||||
it('should handle an asset that could not be found', async () => {
|
||||
await expect(sut.handleLivePhotoLinking({ id: assetStub.image.id })).resolves.toBe(JobStatus.FAILED);
|
||||
|
||||
Reference in New Issue
Block a user