Move nested task back outside try-catch to avoid double-error

This commit is contained in:
Dean Herbert 2022-06-20 15:36:44 +09:00
parent 678b18dde6
commit 882e1c69e5

View File

@ -228,13 +228,6 @@ namespace osu.Game.Database
if (model == null)
return null;
var scheduledImport = Task.Factory.StartNew(() => ImportModel(model, archive, batchImport, cancellationToken),
cancellationToken,
TaskCreationOptions.HideScheduler,
batchImport ? import_scheduler_batch : import_scheduler);
return await scheduledImport.ConfigureAwait(false);
}
catch (TaskCanceledException)
{
@ -245,6 +238,13 @@ namespace osu.Game.Database
LogForModel(model, @$"Model creation of {archive.Name} failed.", e);
return null;
}
var scheduledImport = Task.Factory.StartNew(() => ImportModel(model, archive, batchImport, cancellationToken),
cancellationToken,
TaskCreationOptions.HideScheduler,
batchImport ? import_scheduler_batch : import_scheduler);
return await scheduledImport.ConfigureAwait(false);
}
/// <summary>