Files
Extrudex/backend/Infrastructure/Configuration/MoonrakerPrinterSyncOptions.cs
dex-bot 8b2a29881d
All checks were successful
Dev Build / build-test (pull_request) Successful in 2m7s
Dev Build / deploy-dev (pull_request) Has been skipped
Dev Build / notify-success (pull_request) Has been skipped
Dev Build / notify-failure (pull_request) Has been skipped
feat(CUB-8): Create background service for Moonraker mapping
2026-04-27 20:40:23 -04:00

41 lines
1.5 KiB
C#

namespace Extrudex.Infrastructure.Configuration;
/// <summary>
/// Configuration options for the MoonrakerPrinterSync background service.
/// Bound from appsettings.json under the "MoonrakerPrinterSync" section.
/// Controls polling interval, timeouts, and feature toggles for the
/// printer status and print job mapping service.
/// </summary>
public class MoonrakerPrinterSyncOptions
{
/// <summary>
/// The section name in appsettings.json where these options are bound.
/// </summary>
public const string SectionName = "MoonrakerPrinterSync";
/// <summary>
/// How often the background service polls Moonraker printers for status
/// and print job data. Default: 1 minute.
/// </summary>
public TimeSpan PollingInterval { get; set; } = TimeSpan.FromMinutes(1);
/// <summary>
/// Timeout for individual HTTP requests to a Moonraker printer.
/// Default: 15 seconds.
/// </summary>
public TimeSpan RequestTimeout { get; set; } = TimeSpan.FromSeconds(15);
/// <summary>
/// Whether the Moonraker printer sync service is enabled.
/// Set to false to disable without removing the service registration.
/// Default: true.
/// </summary>
public bool Enabled { get; set; } = true;
/// <summary>
/// Maximum number of print history items to fetch per printer per sync cycle.
/// Controls the batch size when syncing print jobs from Moonraker.
/// Default: 25.
/// </summary>
public int HistoryBatchSize { get; set; } = 25;
}