feat(Program): make Quartz cron schedule configurable via appsettings
- Replaced hardcoded cron expression with configuration-based `Worker:CronExpression`. - Throws descriptive exception if cron expression is missing. - Keeps previous worker and DB context setup unchanged.
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
namespace EnvelopeGenerator.Finalizer.Models;
|
||||
|
||||
public class WorkerOptions
|
||||
{
|
||||
private double _intervalInMin = 1.0;
|
||||
|
||||
public double IntervalInMin {
|
||||
get => _intervalInMin;
|
||||
set
|
||||
{
|
||||
_intervalInMin = value;
|
||||
IntervalInMillisecond = Min2Millisecond(value);
|
||||
}
|
||||
}
|
||||
|
||||
public int IntervalInMillisecond { get; private set; } = Min2Millisecond(1.0);
|
||||
|
||||
private static int Min2Millisecond(double min) => Convert.ToInt32(Math.Round(min * 60 * 1000));
|
||||
}
|
||||
Reference in New Issue
Block a user