consumer: create db connection for each message (debug)

sven/consumer-test
Sven Sauleau 2023-03-01 14:59:08 +00:00
rodzic 74ed95b09b
commit 2cd44e3931
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -22,10 +22,10 @@ export type Env = {
export default {
async queue(batch: MessageBatch<MessageBody>, env: Env, ctx: ExecutionContext) {
const sentry = initSentryQueue(env, ctx)
const db = await getDatabase(env)
try {
for (const message of batch.messages) {
const db = await getDatabase(env)
const actor = await actors.getActorById(db, new URL(message.body.actorId))
if (actor === null) {
console.warn(`actor ${message.body.actorId} is missing`)