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:
parent
79694897be
commit
a0be526266
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user