From d68779d723b7be71aa687e53d7a4ea725e8cc82d Mon Sep 17 00:00:00 2001 From: dholms Date: Thu, 9 Nov 2023 11:32:29 -0600 Subject: [PATCH] dont reimport blobs --- packages/pds/src/api/com/atproto/temp/importRepo.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/pds/src/api/com/atproto/temp/importRepo.ts b/packages/pds/src/api/com/atproto/temp/importRepo.ts index 40502811819..29d9021e942 100644 --- a/packages/pds/src/api/com/atproto/temp/importRepo.ts +++ b/packages/pds/src/api/com/atproto/temp/importRepo.ts @@ -159,6 +159,14 @@ const importBlob = async ( endpoint: string, blob: BlobRef, ) => { + const hasBlob = await actorStore.db.db + .selectFrom('blob') + .selectAll() + .where('cid', '=', blob.ref.toString()) + .executeTakeFirst() + if (hasBlob) { + return + } const res = await axios.get(endpoint, { params: { did: actorStore.repo.did, cid: blob.ref.toString() }, decompress: true,