1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 20:03:22 +08:00

Adjust realm backup procedure to hard fail if running out of attempts

Previously, if the backup procedure failed, startup would continue and
the user's realm database may be deleted. I think in such a fail case
I'd rather the game didn't startup so the user gets in touch (or reads
the log files themselves) rather than potentially losing data.
This commit is contained in:
Dean Herbert 2023-05-30 13:04:32 +09:00
parent 79694897be
commit a0be526266

View File

@ -912,7 +912,7 @@ namespace osu.Game.Database
int attempts = 10;
while (attempts-- > 0)
while (true)
{
try
{
@ -930,6 +930,9 @@ namespace osu.Game.Database
}
catch (IOException)
{
if (attempts-- <= 0)
throw;
// file may be locked during use.
Thread.Sleep(500);
}