mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 14:52:55 +08:00
Catch http errors in full update process (could happen during downloads too).
This commit is contained in:
parent
9e1a3b5d4e
commit
bc032aa0a6
@ -119,17 +119,6 @@ namespace osu.Desktop.Overlays
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
updateManager = await UpdateManager.GitHubUpdateManager(@"https://github.com/ppy/osu", @"osulazer", null, null, true);
|
updateManager = await UpdateManager.GitHubUpdateManager(@"https://github.com/ppy/osu", @"osulazer", null, null, true);
|
||||||
}
|
|
||||||
catch(HttpRequestException)
|
|
||||||
{
|
|
||||||
//check again every 30 minutes.
|
|
||||||
Scheduler.AddDelayed(updateChecker, 60000 * 30);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!updateManager.IsInstalledApp)
|
|
||||||
return;
|
|
||||||
|
|
||||||
var info = await updateManager.CheckForUpdate();
|
var info = await updateManager.CheckForUpdate();
|
||||||
if (info.ReleasesToApply.Count > 0)
|
if (info.ReleasesToApply.Count > 0)
|
||||||
{
|
{
|
||||||
@ -137,13 +126,20 @@ namespace osu.Desktop.Overlays
|
|||||||
{
|
{
|
||||||
Text = @"Downloading update..."
|
Text = @"Downloading update..."
|
||||||
};
|
};
|
||||||
Schedule(() => notification.Post(n));
|
Schedule(() =>
|
||||||
Schedule(() => n.State = ProgressNotificationState.Active);
|
{
|
||||||
await updateManager.DownloadReleases(info.ReleasesToApply, (int p) => Schedule(() => n.Progress = p / 100f));
|
notification.Post(n);
|
||||||
Schedule(() => n.Text = @"Installing update...");
|
n.State = ProgressNotificationState.Active;
|
||||||
await updateManager.ApplyReleases(info, (int p) => Schedule(() => n.Progress = p / 100f));
|
});
|
||||||
Schedule(() => n.State = ProgressNotificationState.Completed);
|
await updateManager.DownloadReleases(info.ReleasesToApply, p => Schedule(() => n.Progress = p / 100f));
|
||||||
|
Schedule(() =>
|
||||||
|
{
|
||||||
|
n.Progress = 0;
|
||||||
|
n.Text = @"Installing update...";
|
||||||
|
});
|
||||||
|
|
||||||
|
await updateManager.ApplyReleases(info, p => Schedule(() => n.Progress = p / 100f));
|
||||||
|
Schedule(() => n.State = ProgressNotificationState.Completed);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -151,6 +147,12 @@ namespace osu.Desktop.Overlays
|
|||||||
Scheduler.AddDelayed(updateChecker, 60000 * 30);
|
Scheduler.AddDelayed(updateChecker, 60000 * 30);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (HttpRequestException)
|
||||||
|
{
|
||||||
|
//check again every 30 minutes.
|
||||||
|
Scheduler.AddDelayed(updateChecker, 60000 * 30);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected override void PopIn()
|
protected override void PopIn()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user