mirror of
https://github.com/ppy/osu.git
synced 2026-06-03 15:54:44 +08:00
Fix metadata cache refetches failing on windows
Reported at https://discord.com/channels/188630481301012481/1097318920991559880/1402910684320108574 among others. Only really visible on windows for reasons outlined in inline comment.
This commit is contained in:
@@ -192,6 +192,13 @@ namespace osu.Game.Beatmaps
|
||||
{
|
||||
try
|
||||
{
|
||||
// `SqliteConnection` by default uses pooling.
|
||||
// disposing an `SqliteConnection` is not enough to get `Microsoft.Data.Sqlite` to close the database file.
|
||||
// this means that overwriting the file may fail if the pools are not cleared before trying.
|
||||
// this fails especially loudly on Windows because of Windows file delete semantics being exclusive-write
|
||||
// rather than Unix's "file is marked for deletion after last reader closes the fd".
|
||||
SqliteConnection.ClearAllPools();
|
||||
|
||||
using (var stream = File.OpenRead(cacheDownloadRequest.Filename))
|
||||
using (var outStream = File.OpenWrite(cacheFilePath))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user