diff --git a/packages/api/src/car.js b/packages/api/src/car.js index 8216800c55..263e10cedb 100644 --- a/packages/api/src/car.js +++ b/packages/api/src/car.js @@ -18,7 +18,6 @@ import { MAX_BLOCK_SIZE, CAR_CODE } from './constants.js' import { JSONResponse } from './utils/json-response.js' import { getPins, PIN_OK_STATUS, waitAndUpdateOkPins } from './utils/pin.js' import { normalizeCid } from './utils/cid.js' -import { rawCarPathToShardCid } from './utils/bucket.js' /** * @typedef {import('multiformats/cid').CID} CID @@ -166,10 +165,6 @@ export async function handleCarUpload (request, env, ctx, car, uploadType = 'Car dagSize }) - if (structure === 'Complete' && env.GENDEX_QUEUE) { - await env.GENDEX_QUEUE.send({ shards: [carCid.toString()] }) - } - /** @type {(() => Promise)[]} */ const tasks = [] @@ -186,16 +181,7 @@ export async function handleCarUpload (request, env, ctx, car, uploadType = 'Car }, { retries: 3 }) if (report.structure === 'Complete') { - return await Promise.all([ - pRetry(() => env.db.upsertPins([elasticPin(report.structure)]), { retries: 3 }), - // trigger block indexes to be built for this DAG - pRetry(async () => { - if (env.GENDEX_QUEUE) { - const shards = report.cars.map(rawCarPathToShardCid).map(cid => cid.toString()) - await env.GENDEX_QUEUE.send({ shards }) - } - }, { retries: 3 }) - ]) + return await pRetry(() => env.db.upsertPins([elasticPin(report.structure)]), { retries: 3 }) } } diff --git a/packages/api/src/utils/bucket.js b/packages/api/src/utils/bucket.js deleted file mode 100644 index cdebd3cd51..0000000000 --- a/packages/api/src/utils/bucket.js +++ /dev/null @@ -1,17 +0,0 @@ -import { fromString } from 'uint8arrays' -import * as Digest from 'multiformats/hashes/digest' -import { CID } from 'multiformats/cid' -import { CAR_CODE } from '../constants.js' - -/** - * Converts a bucket path in format `raw///.car` - * to a CAR CID. - * @param {string} path - */ -export function rawCarPathToShardCid (path) { - const parts = path.split('/') - const filename = String(parts[3]) - const digestBytes = fromString(filename.split('.')[0], 'base32') - const digest = Digest.decode(digestBytes) - return CID.createV1(CAR_CODE, digest) -} diff --git a/packages/api/wrangler.toml b/packages/api/wrangler.toml index 7d74e2688f..e502d16b12 100644 --- a/packages/api/wrangler.toml +++ b/packages/api/wrangler.toml @@ -15,10 +15,6 @@ new_classes = ["NameRoom0"] tag = "v1" deleted_classes = ["NameRoom0"] -[[queues.producers]] - queue = "gendex-dev" - binding = "GENDEX_QUEUE" - # ---- Environment specific overrides below ! ---- # NOTE: wrangler automatically assigns each env the root `name` with the env name suffixed on the end # NOTE: wrangler tries to find an account_id defined at the root if workers_dev = true is not provided on your env. @@ -39,10 +35,6 @@ r2_buckets = [ { binding = "SATNAV", bucket_name = "satnav-test-0" } ] -[[env.test.queues.producers]] - queue = "gendex-test" - binding = "GENDEX_QUEUE" - # PROD! [env.production] # name = "web3-storage-production" @@ -55,10 +47,6 @@ r2_buckets = [ { binding = "SATNAV", bucket_name = "satnav-prod-0" } ] -[[env.production.queues.producers]] - queue = "gendex-production" - binding = "GENDEX_QUEUE" - [env.staging] # name = "web3-storage-staging" account_id = "fffa4b4363a7e5250af8357087263b3a" # Protocol Labs CF account @@ -71,10 +59,6 @@ r2_buckets = [ { binding = "SATNAV", bucket_name = "satnav-staging-0" } ] -[[env.staging.queues.producers]] - queue = "gendex-staging" - binding = "GENDEX_QUEUE" - [env.alan] workers_dev = true account_id = "4fe12d085474d33bdcfd8e9bed4d8f95"