mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 00:09:55 +09:00
Apply ConfigureAwait changes to game side
This commit is contained in:
@ -22,7 +22,6 @@ using osu.Game.IO.Archives;
|
||||
using osu.Game.IPC;
|
||||
using osu.Game.Overlays.Notifications;
|
||||
using SharpCompress.Archives.Zip;
|
||||
using FileInfo = osu.Game.IO.FileInfo;
|
||||
|
||||
namespace osu.Game.Database
|
||||
{
|
||||
@ -163,7 +162,7 @@ namespace osu.Game.Database
|
||||
|
||||
try
|
||||
{
|
||||
var model = await Import(task, isLowPriorityImport, notification.CancellationToken);
|
||||
var model = await Import(task, isLowPriorityImport, notification.CancellationToken).ConfigureAwait(false);
|
||||
|
||||
lock (imported)
|
||||
{
|
||||
@ -183,7 +182,7 @@ namespace osu.Game.Database
|
||||
{
|
||||
Logger.Error(e, $@"Could not import ({task})", LoggingTarget.Database);
|
||||
}
|
||||
}));
|
||||
})).ConfigureAwait(false);
|
||||
|
||||
if (imported.Count == 0)
|
||||
{
|
||||
@ -226,7 +225,7 @@ namespace osu.Game.Database
|
||||
|
||||
TModel import;
|
||||
using (ArchiveReader reader = task.GetReader())
|
||||
import = await Import(reader, lowPriority, cancellationToken);
|
||||
import = await Import(reader, lowPriority, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
// We may or may not want to delete the file depending on where it is stored.
|
||||
// e.g. reconstructing/repairing database with items from default storage.
|
||||
@ -358,7 +357,7 @@ namespace osu.Game.Database
|
||||
item.Files = archive != null ? createFileInfos(archive, Files) : new List<TFileModel>();
|
||||
item.Hash = ComputeHash(item, archive);
|
||||
|
||||
await Populate(item, archive, cancellationToken);
|
||||
await Populate(item, archive, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
using (var write = ContextFactory.GetForWrite()) // used to share a context for full import. keep in mind this will block all writes.
|
||||
{
|
||||
@ -410,7 +409,7 @@ namespace osu.Game.Database
|
||||
|
||||
flushEvents(true);
|
||||
return item;
|
||||
}, cancellationToken, TaskCreationOptions.HideScheduler, lowPriority ? import_scheduler_low_priority : import_scheduler).Unwrap();
|
||||
}, cancellationToken, TaskCreationOptions.HideScheduler, lowPriority ? import_scheduler_low_priority : import_scheduler).Unwrap().ConfigureAwait(false);
|
||||
|
||||
/// <summary>
|
||||
/// Exports an item to a legacy (.zip based) package.
|
||||
@ -621,7 +620,7 @@ namespace osu.Game.Database
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create all required <see cref="FileInfo"/>s for the provided archive, adding them to the global file store.
|
||||
/// Create all required <see cref="IO.FileInfo"/>s for the provided archive, adding them to the global file store.
|
||||
/// </summary>
|
||||
private List<TFileModel> createFileInfos(ArchiveReader reader, FileStore files)
|
||||
{
|
||||
@ -699,7 +698,7 @@ namespace osu.Game.Database
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
return Task.Run(async () => await Import(GetStableImportPaths(storage).ToArray()));
|
||||
return Task.Run(async () => await Import(GetStableImportPaths(storage).ToArray()).ConfigureAwait(false));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Reference in New Issue
Block a user