Files
Umbraco-CMS/src/Umbraco.Core/Configuration/Models/WebhookSettings.cs
Nikolaj Geisle 46df3a05a7 V13: request queueing (#15176)
* Implement persistence

* Start implementing repository

* Implement repository

* Implement request service

* Dont run WebhookFiring if not in runtime mode run

* Refactor repository and service to have full CRUD

* add tests for Request service

* Implement WebhookRequest lock

* Register hosted service

* Add try catch when firing HttpRequest

* Add migration

* Refactor to use renamed IWebhookService

* Refactor tests too

* Add setting to configure webhook firing period

* Update docs

* Review fixes

* Add column renaming migration

* Remove unused service

* run request in parralel

* Refactor to fire parallel in background

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-11-13 15:49:02 +01:00

42 lines
1.4 KiB
C#

using System.ComponentModel;
namespace Umbraco.Cms.Core.Configuration.Models;
[UmbracoOptions(Constants.Configuration.ConfigWebhook)]
public class WebhookSettings
{
private const bool StaticEnabled = true;
private const int StaticMaximumRetries = 5;
internal const string StaticPeriod = "00:00:10";
/// <summary>
/// Gets or sets a value indicating whether webhooks are enabled.
/// </summary>
/// <remarks>
/// <para>
/// By default, webhooks are enabled.
/// If this option is set to <c>false</c> webhooks will no longer send web-requests.
/// </para>
/// </remarks>
[DefaultValue(StaticEnabled)]
public bool Enabled { get; set; } = StaticEnabled;
/// <summary>
/// Gets or sets a value indicating the maximum number of retries for all webhooks.
/// </summary>
/// <remarks>
/// <para>
/// By default, maximum number of retries is 5.
/// If this option is set to <c>0</c> webhooks will no longer retry.
/// </para>
/// </remarks>
[DefaultValue(StaticMaximumRetries)]
public int MaximumRetries { get; set; } = StaticMaximumRetries;
/// <summary>
/// Gets or sets a value for the period of the webhook firing.
/// </summary>
[DefaultValue(StaticPeriod)]
public TimeSpan Period { get; set; } = TimeSpan.Parse(StaticPeriod);
}