Skip to content

Commit

Permalink
dont reimport blobs
Browse files Browse the repository at this point in the history
  • Loading branch information
dholms committed Nov 9, 2023
1 parent 786d4e0 commit d68779d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/pds/src/api/com/atproto/temp/importRepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit d68779d

Please sign in to comment.