mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Fix import cancellation not correctly being forwarded to import notification
This commit is contained in:
@ -156,6 +156,8 @@ namespace osu.Game.Database
|
|||||||
|
|
||||||
bool isLowPriorityImport = tasks.Length > low_priority_import_batch_size;
|
bool isLowPriorityImport = tasks.Length > low_priority_import_batch_size;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
await Task.WhenAll(tasks.Select(async task =>
|
await Task.WhenAll(tasks.Select(async task =>
|
||||||
{
|
{
|
||||||
notification.CancellationToken.ThrowIfCancellationRequested();
|
notification.CancellationToken.ThrowIfCancellationRequested();
|
||||||
@ -183,6 +185,15 @@ namespace osu.Game.Database
|
|||||||
Logger.Error(e, $@"Could not import ({task})", LoggingTarget.Database);
|
Logger.Error(e, $@"Could not import ({task})", LoggingTarget.Database);
|
||||||
}
|
}
|
||||||
})).ConfigureAwait(false);
|
})).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
catch (OperationCanceledException)
|
||||||
|
{
|
||||||
|
if (imported.Count == 0)
|
||||||
|
{
|
||||||
|
notification.State = ProgressNotificationState.Cancelled;
|
||||||
|
return imported;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (imported.Count == 0)
|
if (imported.Count == 0)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user