Skip to content

Commit

Permalink
fix: only send to queue if configured
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Shaw committed Jun 27, 2023
1 parent 9ae6e87 commit f2b3d2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/api/src/car.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export async function handleCarUpload (request, env, ctx, car, uploadType = 'Car

if (structure === 'Complete') {
const message = { block: contentCid, shards: [carCid.toString()], root: contentCid, recursive: true }
await env.GENDEX_QUEUE.send(message)
await env.GENDEX_QUEUE?.send(message)
}

/** @type {(() => Promise<any>)[]} */
Expand All @@ -193,7 +193,7 @@ export async function handleCarUpload (request, env, ctx, car, uploadType = 'Car
pRetry(async () => {
const shards = report.cars.map(rawCarPathToShardCid).map(cid => cid.toString())
const message = { block: contentCid, shards, root: contentCid, recursive: true }
await env.GENDEX_QUEUE.send(message)
await env.GENDEX_QUEUE?.send(message)
}, { retries: 3 })
])
}
Expand Down

0 comments on commit f2b3d2c

Please sign in to comment.