mirror of
https://github.com/immich-app/immich.git
synced 2026-02-13 12:27:56 +03:00
chore(server): change upsert signature for search repo (#8210)
* upsert embedding * remove unused imports
This commit is contained in:
@@ -104,7 +104,6 @@ describe(SmartInfoService.name, () => {
|
||||
});
|
||||
|
||||
it('should save the returned objects', async () => {
|
||||
searchMock.upsert.mockResolvedValue();
|
||||
machineMock.encodeImage.mockResolvedValue([0.01, 0.02, 0.03]);
|
||||
|
||||
await sut.handleEncodeClip({ id: asset.id });
|
||||
@@ -114,12 +113,7 @@ describe(SmartInfoService.name, () => {
|
||||
{ imagePath: 'path/to/resize.ext' },
|
||||
{ enabled: true, modelName: 'ViT-B-32__openai' },
|
||||
);
|
||||
expect(searchMock.upsert).toHaveBeenCalledWith(
|
||||
{
|
||||
assetId: 'asset-1',
|
||||
},
|
||||
[0.01, 0.02, 0.03],
|
||||
);
|
||||
expect(searchMock.upsert).toHaveBeenCalledWith('asset-1', [0.01, 0.02, 0.03]);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ export class SmartInfoService {
|
||||
await this.databaseRepository.wait(DatabaseLock.CLIPDimSize);
|
||||
}
|
||||
|
||||
await this.repository.upsert({ assetId: asset.id }, clipEmbedding);
|
||||
await this.repository.upsert(asset.id, clipEmbedding);
|
||||
|
||||
return JobStatus.SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user