53 lines
1.4 KiB
C#
53 lines
1.4 KiB
C#
using System;
|
|
using Svrnty.CQRS.Events.Configuration;
|
|
|
|
namespace Svrnty.CQRS.Events.Configuration;
|
|
|
|
/// <summary>
|
|
/// Configuration options for read receipt tracking and cleanup.
|
|
/// </summary>
|
|
public class ReadReceiptOptions
|
|
{
|
|
/// <summary>
|
|
/// Whether automatic cleanup of old read receipts is enabled.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Default: true
|
|
/// </para>
|
|
/// <para>
|
|
/// When enabled, a background service will periodically clean up old read receipts.
|
|
/// Disable this if you want to manage cleanup manually.
|
|
/// </para>
|
|
/// </remarks>
|
|
public bool EnableAutoCleanup { get; set; } = true;
|
|
|
|
/// <summary>
|
|
/// How often the cleanup service runs.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Default: 1 hour
|
|
/// </para>
|
|
/// <para>
|
|
/// Only applies when EnableAutoCleanup is true.
|
|
/// </para>
|
|
/// </remarks>
|
|
public TimeSpan CleanupInterval { get; set; } = TimeSpan.FromHours(1);
|
|
|
|
/// <summary>
|
|
/// Maximum age of read receipts before they are deleted.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Default: 30 days
|
|
/// </para>
|
|
/// <para>
|
|
/// Read receipts older than this will be deleted during cleanup.
|
|
/// Keep this long enough for monitoring and troubleshooting but short enough
|
|
/// to prevent unbounded growth.
|
|
/// </para>
|
|
/// </remarks>
|
|
public TimeSpan RetentionPeriod { get; set; } = TimeSpan.FromDays(30);
|
|
}
|