fixed queue cleaner config retrieval

This commit is contained in:
Flaminel
2025-06-06 22:44:08 +03:00
parent 12ab97825b
commit ddbfee33d1
7 changed files with 60 additions and 369 deletions

View File

@@ -158,22 +158,24 @@ public class ConfigurationController : ControllerBase
if (!string.IsNullOrEmpty(config.CronExpression))
{
// If the job is enabled, update its schedule with the configured cron expression
_logger.LogInformation("{JobName} is enabled, updating job schedule with cron expression: {CronExpression}",
_logger.LogInformation("{name} is enabled, updating job schedule with cron expression: {CronExpression}",
jobType.ToString(), config.CronExpression);
_logger.LogCritical("This is a random test log");
// Create a Quartz job schedule with the cron expression
await _jobManagementService.StartJob(jobType, null, config.CronExpression);
}
else
{
_logger.LogWarning("{JobName} is enabled, but no cron expression was found in the configuration", jobType.ToString());
_logger.LogWarning("{name} is enabled, but no cron expression was found in the configuration", jobType.ToString());
}
return;
}
// If the job is disabled, stop it
_logger.LogInformation("{JobName} is disabled, stopping the job", jobType.ToString());
_logger.LogInformation("{name} is disabled, stopping the job", jobType.ToString());
await _jobManagementService.StopJob(jobType);
}

View File

@@ -188,7 +188,7 @@ public class BackgroundJobManager : IHostedService
await _scheduler.ScheduleJob(trigger, cancellationToken);
await _scheduler.ScheduleJob(startupTrigger, cancellationToken);
_logger.LogInformation("Added job {JobName} with cron expression {CronExpression}",
_logger.LogInformation("Added job {name} with cron expression {CronExpression}",
typeName, cronExpression);
}
@@ -215,6 +215,6 @@ public class BackgroundJobManager : IHostedService
// Add job to scheduler
await _scheduler.AddJob(jobDetail, true, cancellationToken);
_logger.LogInformation("Added job {JobName} without trigger (will be chained)", typeName);
_logger.LogInformation("Added job {name} without trigger (will be chained)", typeName);
}
}