mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-12-05 01:04:35 +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
@@ -398,13 +398,13 @@ public sealed class PluginConfiguration(bool isInternal, LuaState state, PluginT
|
||||
ManagedConfiguration.TryProcessConfiguration(x => x.MailboxSettings, x => x.AllowOnlyOrganizationMailServers, this.Id, settingsTable, dryRun);
|
||||
|
||||
// Config: the random pause between two indexing steps of local data sources
|
||||
var minimumPauseIsValid = ManagedConfiguration.TryProcessConfiguration(x => x.App.DataSourceIndexing, x => x.MinimumPauseBetweenStepsSeconds, this.Id, settingsTable, dryRun, validator: value => value is >= 0 and <= DataDataSourceIndexing.MAX_PAUSE_BETWEEN_STEPS_SECONDS);
|
||||
var minimumPauseIsValid = ManagedConfiguration.TryProcessConfiguration(x => x.App.DataSourceIndexing, x => x.MinimumPauseBetweenStepsSeconds, this.Id, settingsTable, dryRun, validator: DataDataSourceIndexing.PAUSE_LIMITS.Allows);
|
||||
if (!minimumPauseIsValid && settingsTable.TryGetValue("DataDataSourceIndexing.MinimumPauseBetweenStepsSeconds", out _))
|
||||
LOG.LogWarning("The lower bound of the pause between indexing steps configured by plugin {ConfigPluginId} must be between 0 and {MaximumPauseSeconds} seconds.", this.Id, DataDataSourceIndexing.MAX_PAUSE_BETWEEN_STEPS_SECONDS);
|
||||
LOG.LogWarning("The lower bound of the pause between indexing steps configured by plugin {ConfigPluginId} must be between {ShortestPauseSeconds} and {LongestPauseSeconds} seconds.", this.Id, DataDataSourceIndexing.PAUSE_LIMITS.ShortestSeconds, DataDataSourceIndexing.PAUSE_LIMITS.LongestSeconds);
|
||||
|
||||
var maximumPauseIsValid = ManagedConfiguration.TryProcessConfiguration(x => x.App.DataSourceIndexing, x => x.MaximumPauseBetweenStepsSeconds, this.Id, settingsTable, dryRun, validator: value => value is >= 0 and <= DataDataSourceIndexing.MAX_PAUSE_BETWEEN_STEPS_SECONDS);
|
||||
var maximumPauseIsValid = ManagedConfiguration.TryProcessConfiguration(x => x.App.DataSourceIndexing, x => x.MaximumPauseBetweenStepsSeconds, this.Id, settingsTable, dryRun, validator: DataDataSourceIndexing.PAUSE_LIMITS.Allows);
|
||||
if (!maximumPauseIsValid && settingsTable.TryGetValue("DataDataSourceIndexing.MaximumPauseBetweenStepsSeconds", out _))
|
||||
LOG.LogWarning("The upper bound of the pause between indexing steps configured by plugin {ConfigPluginId} must be between 0 and {MaximumPauseSeconds} seconds.", this.Id, DataDataSourceIndexing.MAX_PAUSE_BETWEEN_STEPS_SECONDS);
|
||||
LOG.LogWarning("The upper bound of the pause between indexing steps configured by plugin {ConfigPluginId} must be between {ShortestPauseSeconds} and {LongestPauseSeconds} seconds.", this.Id, DataDataSourceIndexing.PAUSE_LIMITS.ShortestSeconds, DataDataSourceIndexing.PAUSE_LIMITS.LongestSeconds);
|
||||
|
||||
if (minimumPauseIsValid && maximumPauseIsValid
|
||||
&& settingsTable.TryGetValue("DataDataSourceIndexing.MinimumPauseBetweenStepsSeconds", out var minimumPauseValue) && minimumPauseValue.TryRead<int>(out var minimumPauseSeconds)
|
||||
@@ -519,9 +519,20 @@ public sealed class PluginConfiguration(bool isInternal, LuaState state, PluginT
|
||||
ManagedConfiguration.TryProcessConfiguration(x => x.BatchProcessing, x => x.CsvSeparator, this.Id, settingsTable, dryRun);
|
||||
ManagedConfiguration.TryProcessConfiguration(x => x.BatchProcessing, x => x.CustomCsvSeparator, this.Id, settingsTable, dryRun);
|
||||
|
||||
var minimumDelayIsValid = ManagedConfiguration.TryProcessConfiguration(x => x.BatchProcessing, x => x.MinimumDelaySeconds, this.Id, settingsTable, dryRun, validator: value => value is >= DataBatchProcessing.MIN_DELAY_SECONDS and <= DataBatchProcessing.MAX_DELAY_SECONDS);
|
||||
// Config: the random pause between two files of the Batch Processing Assistant
|
||||
var minimumDelayIsValid = ManagedConfiguration.TryProcessConfiguration(x => x.BatchProcessing, x => x.MinimumDelaySeconds, this.Id, settingsTable, dryRun, validator: DataBatchProcessing.PAUSE_LIMITS.Allows);
|
||||
if (!minimumDelayIsValid && settingsTable.TryGetValue("DataBatchProcessing.MinimumDelaySeconds", out _))
|
||||
LOG.LogWarning("The Batch Processing minimum delay configured by plugin {ConfigPluginId} must be between {MinimumDelaySeconds} and {MaximumDelaySeconds} seconds.", this.Id, DataBatchProcessing.MIN_DELAY_SECONDS, DataBatchProcessing.MAX_DELAY_SECONDS);
|
||||
LOG.LogWarning("The Batch Processing minimum delay configured by plugin {ConfigPluginId} must be between {MinimumDelaySeconds} and {MaximumDelaySeconds} seconds.", this.Id, DataBatchProcessing.PAUSE_LIMITS.ShortestSeconds, DataBatchProcessing.PAUSE_LIMITS.LongestSeconds);
|
||||
|
||||
var maximumDelayIsValid = ManagedConfiguration.TryProcessConfiguration(x => x.BatchProcessing, x => x.MaximumDelaySeconds, this.Id, settingsTable, dryRun, validator: DataBatchProcessing.PAUSE_LIMITS.Allows);
|
||||
if (!maximumDelayIsValid && settingsTable.TryGetValue("DataBatchProcessing.MaximumDelaySeconds", out _))
|
||||
LOG.LogWarning("The Batch Processing maximum delay configured by plugin {ConfigPluginId} must be between {MinimumDelaySeconds} and {MaximumDelaySeconds} seconds.", this.Id, DataBatchProcessing.PAUSE_LIMITS.ShortestSeconds, DataBatchProcessing.PAUSE_LIMITS.LongestSeconds);
|
||||
|
||||
if (minimumDelayIsValid && maximumDelayIsValid
|
||||
&& settingsTable.TryGetValue("DataBatchProcessing.MinimumDelaySeconds", out var minimumDelayValue) && minimumDelayValue.TryRead<int>(out var minimumDelaySeconds)
|
||||
&& settingsTable.TryGetValue("DataBatchProcessing.MaximumDelaySeconds", out var maximumDelayValue) && maximumDelayValue.TryRead<int>(out var maximumDelaySeconds)
|
||||
&& maximumDelaySeconds < minimumDelaySeconds)
|
||||
LOG.LogWarning("The Batch Processing maximum delay configured by plugin {ConfigPluginId} is below its minimum delay. The minimum delay of {MinimumDelaySeconds} seconds wins.", this.Id, minimumDelaySeconds);
|
||||
|
||||
ManagedConfiguration.TryProcessConfiguration(x => x.BatchProcessing, x => x.MinimumProviderConfidence, this.Id, settingsTable, dryRun);
|
||||
ManagedConfiguration.TryProcessConfiguration(x => x.BatchProcessing, x => x.PreselectedProvider, Guid.Empty, this.Id, settingsTable, dryRun);
|
||||
|
||||
Reference in new issue
Block a user