1
0
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:
Bartłomiej Dach
2025-08-07 10:22:01 +02:00
Unverified
parent 76b09eb677
commit 7da94c4010
@@ -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))
{