mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-18 14:38:00 +00:00
Indexed large data sources in steps so the others get their turn (#1052)
This commit is contained in:
1 parent
fe4a64f382
commit
a3c6b29313
26 files changed
+1932
-334
No files matched your search
@@ -0,0 +1,20 @@
|
||||
namespace AIStudio.Tools.Services.Indexing;
|
||||
|
||||
/// <summary>
|
||||
/// How much work one indexing run does at most, before it leaves the rest to another run.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Only the work on documents counts, cf. DocumentRunProgress.HasDoneItsShare: the clock starts right
|
||||
/// before the first one. Whatever a kind of data source does before, e.g. listing the files of a
|
||||
/// folder, every run has to do anew, and counting it would leave a large folder little time for its
|
||||
/// documents.
|
||||
/// </remarks>
|
||||
/// <param name="MaxDuration">How long a run works on documents at most. More than zero.</param>
|
||||
/// <param name="MaxDocuments">How many documents a run reads at most, whether that works or not. Null when only the time counts.</param>
|
||||
internal sealed record RunShare(TimeSpan MaxDuration, int? MaxDocuments = null)
|
||||
{
|
||||
/// <summary>
|
||||
/// How long a run works on documents, unless its kind of data source has a reason for another time.
|
||||
/// </summary>
|
||||
public static readonly TimeSpan DEFAULT_DURATION = TimeSpan.FromMinutes(5);
|
||||
}
|
||||
Reference in new issue
Block a user