mirror of
https://github.com/Cleanuparr/Cleanuparr.git
synced 2026-06-10 06:45:35 -04:00
fixed queue cleaner config retrieval
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user