mirror of
https://github.com/osukey/osukey.git
synced 2025-05-03 04:37:30 +09:00
Adjust to prevent runaway errors
This commit is contained in:
parent
fca0324264
commit
ae1de1adcb
@ -159,18 +159,16 @@ namespace osu.Game.Collections
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (saveFailures < 10)
|
||||||
saveFailures = 0;
|
saveFailures = 0;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
// Since this code is not thread-safe, we may run into random exceptions (such as collection enumeration or out of range indexing).
|
// Since this code is not thread-safe, we may run into random exceptions (such as collection enumeration or out of range indexing).
|
||||||
// Failures are thus only alerted if they exceed a threshold to indicate "actual" errors.
|
// Failures are thus only alerted if they exceed a threshold (once) to indicate "actual" errors having occurred.
|
||||||
if (++saveFailures >= 10)
|
if (++saveFailures == 10)
|
||||||
{
|
|
||||||
Logger.Error(e, "Failed to save collections");
|
Logger.Error(e, "Failed to save collections");
|
||||||
saveFailures = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user