fix(options): relax EmailAccountsOptions properties from init-only to set
init-only properties cannot be mutated by Options configure delegates. Switching to set allows the builder pattern to bind values post-construction. Also narrows Accounts type from IEnumerable to List for index access.
This commit is contained in:
@@ -17,18 +17,18 @@ public class EmailAccountsOptions
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The list of configured email accounts.
|
/// The list of configured email accounts.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public required IEnumerable<EmailAccountModificationDto> Accounts { get; init; } = [];
|
public required List<EmailAccountModificationDto> Accounts { get; set; } = [];
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// How often the IMAP sync worker polls for new emails, in seconds.
|
/// How often the IMAP sync worker polls for new emails, in seconds.
|
||||||
/// Defaults to 300 seconds (5 minutes).
|
/// Defaults to 300 seconds (5 minutes).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int SyncIntervalSeconds { get; init; } = 300;
|
public int SyncIntervalSeconds { get; set; } = 300;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The minimum interval, in seconds, between forced IMAP sync operations regardless of idle state.
|
/// The minimum interval, in seconds, between forced IMAP sync operations regardless of idle state.
|
||||||
/// Defaults to 30 seconds (0.5 minute).
|
/// Defaults to 30 seconds (0.5 minute).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int ForcedSyncIntervalSeconds { get; init; } = 30;
|
public int ForcedSyncIntervalSeconds { get; set; } = 30;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
Reference in New Issue
Block a user