mirror of https://github.com/ppy/osu
Fix import after direct download being scheduled to update thread
Caused a stall as experienced in #1364.
This commit is contained in:
parent
c765785d00
commit
040fa3aa15
|
@ -246,9 +246,13 @@ public DownloadBeatmapSetRequest Download(BeatmapSetInfo beatmapSetInfo)
|
|||
{
|
||||
downloadNotification.State = ProgressNotificationState.Completed;
|
||||
|
||||
using (var stream = new MemoryStream(data))
|
||||
using (var archive = new OszArchiveReader(stream))
|
||||
Import(archive);
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
// This gets scheduled back to the update thread, but we want the import to run in the background.
|
||||
using (var stream = new MemoryStream(data))
|
||||
using (var archive = new OszArchiveReader(stream))
|
||||
Import(archive);
|
||||
}, TaskCreationOptions.LongRunning);
|
||||
|
||||
currentDownloads.Remove(request);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue