Files
2025-06-22 04:53:33 +03:00

33 lines
979 B
C#

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Cleanuparr.Persistence.Models.Configuration.QueueCleaner;
public sealed record QueueCleanerConfig : IJobConfig
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid Id { get; init; } = Guid.NewGuid();
public bool Enabled { get; set; }
public string CronExpression { get; set; } = "0 0/5 * * * ?";
/// <summary>
/// Indicates whether to use the CronExpression directly or convert from a user-friendly schedule
/// </summary>
public bool UseAdvancedScheduling { get; set; } = false;
public FailedImportConfig FailedImport { get; set; } = new();
public StalledConfig Stalled { get; set; } = new();
public SlowConfig Slow { get; set; } = new();
public void Validate()
{
FailedImport.Validate();
Stalled.Validate();
Slow.Validate();
}
}