Remove duplicates before creating deletion queue

This commit is contained in:
silverpill 2022-07-06 22:36:13 +00:00
parent 255aca68de
commit 94bd5bdbb5

View file

@ -36,7 +36,7 @@ pub async fn find_orphaned_files(
) -> Result<Vec<String>, DatabaseError> {
let rows = db_client.query(
"
SELECT fname
SELECT DISTINCT fname
FROM unnest($1::text[]) AS fname
WHERE
NOT EXISTS (
@ -61,7 +61,7 @@ pub async fn find_orphaned_ipfs_objects(
) -> Result<Vec<String>, DatabaseError> {
let rows = db_client.query(
"
SELECT cid
SELECT DISTINCT cid
FROM unnest($1::text[]) AS cid
WHERE
NOT EXISTS (