Hey fellows, I've got a really simple

Hey fellows, I've got a really simple queues and d1 setup that is deployed as a worker. It is a consumer and a producer of the job that it handles. It basically uses the default wrangler.toml and I followed the tutorials on the respective page to set it up. The fetch just publishes a single event, the queue just logs it
export default {
async fetch(request: Request<unknown, IncomingRequestCfProperties<unknown>>, env: Env, ctx: ExecutionContext): Promise<Response> {
await env.aramDataCollectionQueue.send({
riot_puuid: "secret",
region: RegionGroups.SEA
})

return new Response("Success");
},

queue(batch: MessageBatch<CollectAramDataJob>, env: Env, ctx: ExecutionContext): void | Promise<void> {
console.log(batch);
}
} satisfies ExportedHandler<Env, CollectAramDataJob>
export default {
async fetch(request: Request<unknown, IncomingRequestCfProperties<unknown>>, env: Env, ctx: ExecutionContext): Promise<Response> {
await env.aramDataCollectionQueue.send({
riot_puuid: "secret",
region: RegionGroups.SEA
})

return new Response("Success");
},

queue(batch: MessageBatch<CollectAramDataJob>, env: Env, ctx: ExecutionContext): void | Promise<void> {
console.log(batch);
}
} satisfies ExportedHandler<Env, CollectAramDataJob>
I am trying to develop locally with bunx wrangler dev but when I go to the url it runs on it just hangs for a while with no error output. After a reasonable amount of time it will start lagging out my computer and starts spamming to console
[wrangler:inf] GET / 500 Internal Server Error (78202ms)
[wrangler:inf] GET / 500 Internal Server Error (78202ms)
I am very new to cloudflare in general but I couldnt find anything in the docs
1 Reply
pat
patOP3mo ago
This is so painful to come back after literally 3 minutes with a solution... I just chucked an async on the queue function and bam, it works. Pain I'm not sure if this is a bug btw, the interface seems to allow async or sync - maybe this is just a quirk of cloudflare I'm not aware of?
Want results from more Discord servers?
Add your server