File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,7 @@ import type { Job } from 'bullmq';
22import { Queue } from 'bullmq' ;
33import { BullMQOtel } from 'bullmq-otel' ;
44import { Redis } from 'ioredis' ;
5- import { DatabaseWrites } from '../database' ;
6- import prismaInternal , { DatabaseReads } from '../database/prisma' ;
5+ import prismaInternal from '../database/prisma' ;
76import { Workflow } from '../workflow' ;
87import type {
98 BaseJob ,
@@ -118,8 +117,8 @@ let _queues: ReturnType<typeof createQueues> | undefined = undefined;
118117async function createJobRecord ( job : Job < BaseJob > ) {
119118 try {
120119 if ( job . id && job . data . transition ) {
121- await prismaInternal . $transaction ( async ( ) => {
122- const existing = await DatabaseReads . productTransitions . findFirst ( {
120+ await prismaInternal . $transaction ( async ( tx ) => {
121+ const existing = await tx . productTransitions . findFirst ( {
123122 where : { Id : job . data . transition }
124123 } ) ;
125124
@@ -138,7 +137,7 @@ async function createJobRecord(job: Job<BaseJob>) {
138137 }
139138 }
140139
141- return await DatabaseWrites . queueRecords . create ( {
140+ return await tx . queueRecords . create ( {
142141 data : {
143142 ProductTransitionId : job . data . transition ! ,
144143 Queue : job . queueName ,
You can’t perform that action at this time.
0 commit comments