1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-31 14:25:10 +08:00

Adjust code style slightly

This commit is contained in:
Dean Herbert 2025-01-22 17:03:01 +09:00
parent b0c0c98c5d
commit 910c0022e3
No known key found for this signature in database

View File

@ -114,14 +114,25 @@ namespace osu.Game.Beatmaps
} }
} }
} }
catch (SqliteException sqliteException) when (sqliteException.SqliteErrorCode == 11 || sqliteException.SqliteErrorCode == 26) // SQLITE_CORRUPT, SQLITE_NOTADB catch (SqliteException sqliteException)
{ {
// only attempt purge & refetch if there is no other refetch in progress // There have been cases where the user's local database is corrupt.
if (cacheDownloadRequest == null) // Let's attempt to identify these cases and re-initialise the local cache.
switch (sqliteException.SqliteErrorCode)
{ {
tryPurgeCache(); case 26: // SQLITE_NOTADB
prepareLocalCache(); case 11: // SQLITE_CORRUPT
// only attempt purge & re-download if there is no other refetch in progress
if (cacheDownloadRequest != null)
throw;
tryPurgeCache();
prepareLocalCache();
onlineMetadata = null;
return false;
} }
throw;
} }
catch (Exception ex) catch (Exception ex)
{ {