mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-12-04 05:52:02 +00:00
Improved the pauses between indexing steps and between files of the Batch Processing Assistant (#1240)
This commit is contained in:
1 parent
a117074972
commit
899139c88b
32 files changed
+787
-425
No files matched your search
@@ -0,0 +1,31 @@
|
||||
using AIStudio.Tools.Pauses;
|
||||
|
||||
namespace AIStudio.Settings.DataModel;
|
||||
|
||||
public static class DataDataSourceIndexingExtensions
|
||||
{
|
||||
/// <param name="settings">The settings of the indexing.</param>
|
||||
extension(DataDataSourceIndexing settings)
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether a configuration plugin locks the lower bound of the pause between two indexing steps.
|
||||
/// </summary>
|
||||
public static bool IsMinimumPauseLocked => ManagedConfiguration.TryGet(x => x.App.DataSourceIndexing, x => x.MinimumPauseBetweenStepsSeconds, out var meta) && meta.IsLocked;
|
||||
|
||||
/// <summary>
|
||||
/// Whether a configuration plugin locks the upper bound of the pause between two indexing steps.
|
||||
/// </summary>
|
||||
public static bool IsMaximumPauseLocked => ManagedConfiguration.TryGet(x => x.App.DataSourceIndexing, x => x.MaximumPauseBetweenStepsSeconds, out var meta) && meta.IsLocked;
|
||||
|
||||
/// <summary>
|
||||
/// The bounds of the pause between two indexing steps which apply now, as the user set them
|
||||
/// and as configuration plugins lock them, cf. PauseRange.GetEffective.
|
||||
/// </summary>
|
||||
public PauseRange EffectivePauseRange => PauseRange.GetEffective(
|
||||
DataDataSourceIndexing.PAUSE_LIMITS,
|
||||
settings.MinimumPauseBetweenStepsSeconds,
|
||||
() => DataDataSourceIndexing.IsMinimumPauseLocked,
|
||||
settings.MaximumPauseBetweenStepsSeconds,
|
||||
() => DataDataSourceIndexing.IsMaximumPauseLocked);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user