fix(server): queueing for duplicate detection (#18380)

* fix queueing

* update tests
This commit is contained in:
Mert 2025-05-20 09:44:39 -04:00 committed by GitHub
parent 0d773af6c3
commit a6a4dfcfd3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 18 additions and 70 deletions

View file

@ -8,30 +8,14 @@ select
"duplicateId",
"stackId",
"visibility",
"smart_search"."embedding",
(
select
coalesce(json_agg(agg), '[]')
from
(
select
"asset_files"."id",
"asset_files"."path",
"asset_files"."type"
from
"asset_files"
where
"asset_files"."assetId" = "assets"."id"
and "asset_files"."type" = $1
) as agg
) as "files"
"smart_search"."embedding"
from
"assets"
left join "smart_search" on "assets"."id" = "smart_search"."assetId"
where
"assets"."id" = $2::uuid
"assets"."id" = $1::uuid
limit
$3
$2
-- AssetJobRepository.getForSidecarWriteJob
select
@ -199,18 +183,11 @@ select
"assets"."id"
from
"assets"
inner join "smart_search" on "assets"."id" = "smart_search"."assetId"
inner join "asset_job_status" as "job_status" on "assetId" = "assets"."id"
where
"assets"."visibility" != $1
and "assets"."deletedAt" is null
and "job_status"."previewAt" is not null
and not exists (
select
from
"smart_search"
where
"assetId" = "assets"."id"
)
and "job_status"."duplicatesDetectedAt" is null
-- AssetJobRepository.streamForEncodeClip