Files
git.stella-ops.org/templates/stellaops-plugin-scheduler/MyJobOptions.cs
StellaOps Bot b058dbe031 up
2025-12-14 23:20:14 +02:00

44 lines
1.1 KiB
C#

using System.ComponentModel.DataAnnotations;
namespace StellaOps.Plugin.MyJob;
/// <summary>
/// Configuration options for the MyJob scheduled plugin.
/// </summary>
public sealed class MyJobOptions
{
/// <summary>
/// The configuration section name.
/// </summary>
public const string SectionName = "Plugins:MyJob";
/// <summary>
/// Gets or sets the cron schedule expression.
/// Default: "0 0 * * *" (daily at midnight).
/// </summary>
[Required]
public string CronSchedule { get; set; } = "0 0 * * *";
/// <summary>
/// Gets or sets whether the job is enabled.
/// </summary>
public bool Enabled { get; set; } = true;
/// <summary>
/// Gets or sets the maximum execution time in minutes.
/// </summary>
[Range(1, 1440)]
public int MaxExecutionMinutes { get; set; } = 60;
/// <summary>
/// Gets or sets the batch size for processing items.
/// </summary>
[Range(1, 10000)]
public int BatchSize { get; set; } = 100;
/// <summary>
/// Gets or sets whether to continue processing on error.
/// </summary>
public bool ContinueOnError { get; set; }
}