mirror of https://github.com/ppy/osu
Mark several long-running tasks as long-running
This commit is contained in:
parent
89cc7b7945
commit
c765785d00
|
@ -106,7 +106,7 @@ private void fileDrop(object sender, FileDropEventArgs e)
|
|||
var filePaths = new [] { e.FileName };
|
||||
|
||||
if (filePaths.All(f => Path.GetExtension(f) == @".osz"))
|
||||
Task.Run(() => BeatmapManager.Import(filePaths));
|
||||
Task.Factory.StartNew(() => BeatmapManager.Import(filePaths), TaskCreationOptions.LongRunning);
|
||||
else if (filePaths.All(f => Path.GetExtension(f) == @".osr"))
|
||||
Task.Run(() =>
|
||||
{
|
||||
|
|
|
@ -272,7 +272,7 @@ public DownloadBeatmapSetRequest Download(BeatmapSetInfo beatmapSetInfo)
|
|||
PostNotification?.Invoke(downloadNotification);
|
||||
|
||||
// don't run in the main api queue as this is a long-running task.
|
||||
Task.Run(() => request.Perform(api));
|
||||
Task.Factory.StartNew(() => request.Perform(api), TaskCreationOptions.LongRunning);
|
||||
|
||||
return request;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,8 @@ private void load(BeatmapManager beatmaps)
|
|||
Action = () =>
|
||||
{
|
||||
importButton.Enabled.Value = false;
|
||||
Task.Run(() => beatmaps.ImportFromStable()).ContinueWith(t => Schedule(() => importButton.Enabled.Value = true));
|
||||
Task.Factory.StartNew(beatmaps.ImportFromStable)
|
||||
.ContinueWith(t => Schedule(() => importButton.Enabled.Value = true), TaskContinuationOptions.LongRunning);
|
||||
}
|
||||
},
|
||||
deleteButton = new SettingsButton
|
||||
|
|
Loading…
Reference in New Issue