File tree Expand file tree Collapse file tree
apps/web/lib/actions/partners Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -101,6 +101,8 @@ export const createManualCommissionAction = authActionClient
101101 description,
102102 } ) ;
103103
104+ waitUntil ( triggerAggregateDueCommissionsCronJob ( programId ) ) ;
105+
104106 return ;
105107 }
106108
@@ -580,15 +582,19 @@ export const createManualCommissionAction = authActionClient
580582 ] ) ;
581583 }
582584
583- const qstashResponse = await qstash . publishJSON ( {
584- url : `${ APP_DOMAIN_WITH_NGROK } /api/cron/payouts/aggregate-due-commissions` ,
585- body : {
586- programId,
587- } ,
588- } ) ;
589- console . log (
590- `Triggered aggregate due commissions cron job for program ${ programId } : ${ prettyPrint ( qstashResponse ) } ` ,
591- ) ;
585+ await triggerAggregateDueCommissionsCronJob ( programId ) ;
592586 } ) ( ) ,
593587 ) ;
594588 } ) ;
589+
590+ async function triggerAggregateDueCommissionsCronJob ( programId : string ) {
591+ const qstashResponse = await qstash . publishJSON ( {
592+ url : `${ APP_DOMAIN_WITH_NGROK } /api/cron/payouts/aggregate-due-commissions` ,
593+ body : {
594+ programId,
595+ } ,
596+ } ) ;
597+ console . log (
598+ `Triggered aggregate due commissions cron job for program ${ programId } : ${ prettyPrint ( qstashResponse ) } ` ,
599+ ) ;
600+ }
You can’t perform that action at this time.
0 commit comments