2020-12-06 10:46:04 +01:00
// Copyright (c) Umbraco.
// See LICENSE for more details.
using System ;
2021-07-05 14:27:49 +01:00
using System.ComponentModel ;
2020-11-10 20:02:09 +01:00
2021-02-18 11:06:02 +01:00
namespace Umbraco.Cms.Core.Configuration.Models
2020-11-10 20:02:09 +01:00
{
2020-12-06 10:46:04 +01:00
/// <summary>
/// Typed configuration options for database server messaging settings.
/// </summary>
2020-11-10 20:02:09 +01:00
public class DatabaseServerMessengerSettings
{
2021-07-05 14:27:49 +01:00
internal const int StaticMaxProcessingInstructionCount = 1000 ;
internal const string StaticTimeToRetainInstructions = "2.00:00:00" ; // TimeSpan.FromDays(2);
internal const string StaticTimeBetweenSyncOperations = "00:00:05" ; // TimeSpan.FromSeconds(5);
internal const string StaticTimeBetweenPruneOperations = "00:01:00" ; // TimeSpan.FromMinutes(1);
2020-11-10 20:02:09 +01:00
/// <summary>
2020-12-06 10:46:04 +01:00
/// Gets or sets a value for the maximum number of instructions that can be processed at startup; otherwise the server cold-boots (rebuilds its caches).
2020-11-10 20:02:09 +01:00
/// </summary>
2021-07-05 14:27:49 +01:00
[DefaultValue(StaticMaxProcessingInstructionCount)]
public int MaxProcessingInstructionCount { get ; set ; } = StaticMaxProcessingInstructionCount ;
2020-11-10 20:02:09 +01:00
/// <summary>
2020-12-06 10:46:04 +01:00
/// Gets or sets a value for the time to keep instructions in the database; records older than this number will be pruned.
2020-11-10 20:02:09 +01:00
/// </summary>
2021-07-05 14:27:49 +01:00
[DefaultValue(StaticTimeToRetainInstructions)]
public TimeSpan TimeToRetainInstructions { get ; set ; } = TimeSpan . Parse ( StaticTimeToRetainInstructions ) ;
2020-11-10 20:02:09 +01:00
/// <summary>
2020-12-06 10:46:04 +01:00
/// Gets or sets a value for the time to wait between each sync operations.
2020-11-10 20:02:09 +01:00
/// </summary>
2021-07-05 14:27:49 +01:00
[DefaultValue(StaticTimeBetweenSyncOperations)]
public TimeSpan TimeBetweenSyncOperations { get ; set ; } = TimeSpan . Parse ( StaticTimeBetweenSyncOperations ) ;
2020-11-10 20:02:09 +01:00
/// <summary>
2020-12-06 10:46:04 +01:00
/// Gets or sets a value for the time to wait between each prune operations.
2020-11-10 20:02:09 +01:00
/// </summary>
2021-07-05 14:27:49 +01:00
[DefaultValue(StaticTimeBetweenPruneOperations)]
public TimeSpan TimeBetweenPruneOperations { get ; set ; } = TimeSpan . Parse ( StaticTimeBetweenPruneOperations ) ;
2020-11-10 20:02:09 +01:00
}
}