File tree Expand file tree Collapse file tree
internal-packages/run-engine/src/engine Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -364,6 +364,7 @@ export class RunEngine {
364364 scheduleInstanceId,
365365 createdAt,
366366 bulkActionId,
367+ planType,
367368 } : TriggerParams ,
368369 tx ?: PrismaClientOrTransaction
369370 ) : Promise < TaskRun > {
@@ -374,37 +375,13 @@ export class RunEngine {
374375 "trigger" ,
375376 async ( span ) => {
376377 const status = delayUntil ? "DELAYED" : "PENDING" ;
377- const runId = RunId . fromFriendlyId ( friendlyId ) ;
378-
379- // Get billing information to store with the run
380- let planType : string | undefined ;
381- const currentPlan = await this . billingCache . getCurrentPlan ( environment . organization . id ) ;
382-
383- if ( currentPlan . err || ! currentPlan . val ) {
384- // If billing lookup fails, don't block the trigger - planType will be undefined
385- this . logger . warn (
386- "Failed to get billing info during trigger, proceeding without planType" ,
387- {
388- orgId : environment . organization . id ,
389- runId,
390- error :
391- currentPlan . err instanceof Error
392- ? currentPlan . err . message
393- : String ( currentPlan . err ) ,
394- hasValue : ! ! currentPlan . val ,
395- }
396- ) ;
397- planType = undefined ;
398- } else {
399- planType = currentPlan . val . type ;
400- }
401378
402379 //create run
403380 let taskRun : TaskRun ;
404381 try {
405382 taskRun = await prisma . taskRun . create ( {
406383 data : {
407- id : runId ,
384+ id : RunId . fromFriendlyId ( friendlyId ) ,
408385 engine : "V2" ,
409386 status,
410387 number,
Original file line number Diff line number Diff line change @@ -136,6 +136,7 @@ export type TriggerParams = {
136136 scheduleInstanceId ?: string ;
137137 createdAt ?: Date ;
138138 bulkActionId ?: string ;
139+ planType ?: string ;
139140} ;
140141
141142export type EngineWorker = Worker < typeof workerCatalog > ;
You can’t perform that action at this time.
0 commit comments