diff --git a/src/modules/workspace/services/testflow-schedular.service.ts b/src/modules/workspace/services/testflow-schedular.service.ts index 292d98a5f..6fc81fbd2 100644 --- a/src/modules/workspace/services/testflow-schedular.service.ts +++ b/src/modules/workspace/services/testflow-schedular.service.ts @@ -18,14 +18,12 @@ export class TestflowSchedulerService { runCycle: RunCycleConfig, runApis: (schedularId: string) => Promise, afterJobCreate: (cronExpression: string) => void, - jobName: string, cronExpression: string, schedularId: string, timezone: string = "UTC", // Always use UTC by default ): Promise { if (!cronExpression) { - console.error(`Invalid run cycle configuration for job ${jobName}`); - this.logger.log(`Invalid run cycle configuration for job ${jobName}`); + this.logger.log(`Invalid run cycle configuration for job ${schedularId}`); return false; } try { @@ -114,7 +112,7 @@ export class TestflowSchedulerService { await runApis(schedularId); } catch (error) { this.logger.error( - `Error executing job ${jobName}: ${error.message}`, + `Error executing job ${schedularId}: ${error.message}`, error.stack ); } @@ -122,19 +120,19 @@ export class TestflowSchedulerService { // Handle one-time jobs if (runCycle.type === RunCycleEnum.ONCE) { job.stop(); - this.schedulerRegistry.deleteCronJob(jobName); + this.schedulerRegistry.deleteCronJob(schedularId); } }, null, // onComplete callback false, // start - we'll call start() manually timezone, // Set timezone to UTC ); - this.schedulerRegistry.addCronJob(jobName, job); + this.schedulerRegistry.addCronJob(schedularId, job); job.start(); return true; } catch (error) { this.logger.error( - `Failed to create scheduler job ${jobName}: ${error.message}`, + `Failed to create scheduler job ${schedularId}: ${error.message}`, error.stack ); return false; diff --git a/src/modules/workspace/services/testflow.service.ts b/src/modules/workspace/services/testflow.service.ts index b61f10890..271f232f9 100644 --- a/src/modules/workspace/services/testflow.service.ts +++ b/src/modules/workspace/services/testflow.service.ts @@ -151,7 +151,6 @@ export class TestflowService implements OnModuleInit { cronExpression: _cronExpression, }); }, - schedule.schedularName, cronExpression, schedule.id, "UTC", @@ -282,9 +281,9 @@ export class TestflowService implements OnModuleInit { cronExpression: _cronExpression, }); }, - schedular.schedularName, cronExpression, scheduleId, + "UTC", ); } } @@ -640,7 +639,6 @@ export class TestflowService implements OnModuleInit { cronExpression: _cronExpression, }); }, - jobName, cronExpression, schedulerId, "UTC",