chore: register schedule worker
This commit is contained in:
@@ -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
|
||||
@@ -28,6 +29,8 @@ export async function scheduleWorkflow(id: string, userId: string, cronExpressi
|
||||
{ tz: timezone }
|
||||
);
|
||||
|
||||
await registerWorkerForQueue(queueName);
|
||||
|
||||
logger.log('info', `Scheduled workflow job for robot ${id}`);
|
||||
} catch (error: unknown) {
|
||||
const errorMessage = error instanceof Error ? error.message : String(error);
|
||||
|
||||
Reference in New Issue
Block a user