Files
QuantEngineByItz/src/dotnet/QuantEngine.Web/Services/SchedulerModels.cs
T
kjh2064 c852ad49cf
Validators (Pushes and Pull Requests) / validate-ui-and-storage (push) Successful in 16s
Validators (Pushes and Pull Requests) / validate-core (push) Has been cancelled
refactor(dotnet): externalize scheduler definitions
2026-07-13 00:39:59 +09:00

40 lines
1.2 KiB
C#

namespace QuantEngine.Web.Services;
using System;
public sealed record SchedulerJobDefinition(
string JobId,
string Cron,
string Description,
bool IsRecurring);
public sealed record SchedulerServiceOptions
{
public List<SchedulerJobDefinition> JobDefinitions { get; init; } = new()
{
new SchedulerJobDefinition("daily-collection", "0 9 * * *", "Daily data collection", true),
new SchedulerJobDefinition("hourly-price-update", "0 9,11,13,15 * * 1-5", "Hourly price update", true),
new SchedulerJobDefinition("weekly-report", "0 17 * * 5", "Weekly report generation", true),
new SchedulerJobDefinition("monthly-optimization", "0 2 1 * *", "Monthly optimization", true),
};
}
public sealed record SchedulerJobExecutionAudit(
string JobId,
string RunId,
string State,
string? Reason,
DateTimeOffset StartedAt,
DateTimeOffset? FinishedAt,
string? ResourceKey);
public static class SchedulerStates
{
public const string Pending = "PENDING";
public const string Running = "RUNNING";
public const string Succeeded = "SUCCEEDED";
public const string Failed = "FAILED";
public const string Retrying = "RETRYING";
public const string Blocked = "BLOCKED";
}