add WorkerOptions.

- bind IntervalInMin with worker task delay
This commit is contained in:
2025-11-03 16:38:41 +01:00
parent 187f4a42fc
commit b5cd42b6fa
8 changed files with 159 additions and 2 deletions

View File

@@ -0,0 +1,19 @@
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));
}