helper for throttling indexes

This commit is contained in:
2022-01-14 19:41:13 +01:00
parent e81f786820
commit 68c6a92c33
2 changed files with 20 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
namespace zero.Persistence;
public static partial class RavenConstants
{
public static partial class Indexing
{
public const string ThrottlingTimeIntervalInMs = "Indexing.Throttling.TimeIntervalInMs";
}
}
@@ -0,0 +1,11 @@
using Raven.Client.Documents.Indexes;
namespace zero.Persistence;
public static class RavenIndexExtensions
{
public static void Throttle(this AbstractCommonApiForIndexes index, TimeSpan delay)
{
index.Configuration[RavenConstants.Indexing.ThrottlingTimeIntervalInMs] = delay.TotalMilliseconds.ToString();
}
}