1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 00:42:55 +08:00

Change batch import to require at least 10 items

This commit is contained in:
Dean Herbert 2022-06-15 15:31:58 +09:00
parent abe947bcb0
commit 5201057a62

View File

@ -32,8 +32,17 @@ namespace osu.Game.Stores
public abstract class RealmArchiveModelImporter<TModel> : IModelImporter<TModel>
where TModel : RealmObject, IHasRealmFiles, IHasGuidPrimaryKey, ISoftDelete
{
/// <summary>
/// The maximum number of concurrent imports to run per import scheduler.
/// </summary>
private const int import_queue_request_concurrency = 1;
/// <summary>
/// The minimum number of items in a single import call in order for the import to be processed as a batch.
/// Batch imports will apply optimisations preferring speed over consistency when detecting changes in already-imported items.
/// </summary>
private const int minimum_items_considered_batch_import = 10;
/// <summary>
/// A singleton scheduler shared by all <see cref="RealmArchiveModelImporter{TModel}"/>.
/// </summary>
@ -100,7 +109,7 @@ namespace osu.Game.Stores
var imported = new List<Live<TModel>>();
bool isBatchImport = tasks.Length > 1;
bool isBatchImport = tasks.Length >= minimum_items_considered_batch_import;
try
{