helper for throttling indexes
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user