mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 10:33:30 +08:00
Ensure reading of existing databases when making backups doesn't create a file
This commit is contained in:
parent
1c3cc985bc
commit
739a696467
@ -151,7 +151,7 @@ namespace osu.Game.Database
|
||||
{
|
||||
Logger.Log($"Creating full EF database backup at {backupFilename}", LoggingTarget.Database);
|
||||
|
||||
using (var source = storage.GetStream(DATABASE_NAME))
|
||||
using (var source = storage.GetStream(DATABASE_NAME, mode: FileMode.Open))
|
||||
using (var destination = storage.GetStream(backupFilename, FileAccess.Write, FileMode.CreateNew))
|
||||
source.CopyTo(destination);
|
||||
}
|
||||
|
@ -762,7 +762,7 @@ namespace osu.Game.Database
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var source = storage.GetStream(Filename))
|
||||
using (var source = storage.GetStream(Filename, mode: FileMode.Open))
|
||||
using (var destination = storage.GetStream(backupFilename, FileAccess.Write, FileMode.CreateNew))
|
||||
source.CopyTo(destination);
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user