mirror of
https://github.com/ppy/osu.git
synced 2026-05-30 13:30:57 +08:00
Merge pull request #32327 from peppy/touch-realm-before-using
Ensure realm database file is touched on startup
This commit is contained in:
@@ -315,6 +315,17 @@ namespace osu.Game.Database
|
||||
attemptRecoverFromFile(newerVersionFilename);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// Some platforms' realm implementation (including windows) don't update modified time on open.
|
||||
// Let's do this explicitly as some users may depend on it roughly aligning to usage expectations.
|
||||
string fullPath = storage.GetFullPath(Filename);
|
||||
var fi = new FileInfo(fullPath);
|
||||
if (fi.Exists)
|
||||
fi.LastWriteTime = DateTime.Now;
|
||||
}
|
||||
catch { }
|
||||
|
||||
try
|
||||
{
|
||||
return getRealmInstance();
|
||||
|
||||
Reference in New Issue
Block a user