chore: revert scheduling user id logic

This commit is contained in:
Rohit Rajan
2025-12-08 18:13:01 +05:30
parent e23f24207a
commit a03609c873
3 changed files with 5 additions and 4 deletions

View File

@@ -5,6 +5,7 @@
import { v4 as uuid } from 'uuid';
import logger from '../logger';
import { pgBossClient } from './pgboss';
import { registerWorkerForQueue } from '../schedule-worker';
/**
* Utility function to schedule a cron job using PgBoss
@@ -13,7 +14,7 @@ import { pgBossClient } from './pgboss';
* @param cronExpression The cron expression for scheduling
* @param timezone The timezone for the cron expression
*/
export async function scheduleWorkflow(id: string, cronExpression: string, timezone: string): Promise<void> {
export async function scheduleWorkflow(id: string, userId: string, cronExpression: string, timezone: string): Promise<void> {
try {
const runId = uuid();
@@ -24,7 +25,7 @@ export async function scheduleWorkflow(id: string, cronExpression: string, timez
await pgBossClient.createQueue(queueName);
await pgBossClient.schedule(queueName, cronExpression,
{ id, runId },
{ id, runId, userId },
{ tz: timezone }
);