1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-01 23:00:50 +08:00

Run cleanup tasks only on startup via manual calls

This commit is contained in:
Dean Herbert
2017-10-17 19:58:33 +09:00
Unverified
parent b9d0fb96ed
commit e4a066dc5f
5 changed files with 8 additions and 18 deletions
+2
View File
@@ -104,6 +104,8 @@ namespace osu.Game.Beatmaps
if (importHost != null)
ipc = new BeatmapIPCChannel(importHost, this);
beatmaps.Cleanup();
}
/// <summary>
+1 -7
View File
@@ -40,12 +40,6 @@ namespace osu.Game.Beatmaps
}
}
protected override void StartupTasks()
{
base.StartupTasks();
cleanupPendingDeletions();
}
/// <summary>
/// Add a <see cref="BeatmapSetInfo"/> to the database.
/// </summary>
@@ -136,7 +130,7 @@ namespace osu.Game.Beatmaps
return true;
}
private void cleanupPendingDeletions()
public override void Cleanup()
{
var context = GetContext();
+2 -4
View File
@@ -27,14 +27,12 @@ namespace osu.Game.Database
Logger.Error(e, $@"Failed to initialise the {GetType()}! Trying again with a clean database...");
Prepare(true);
}
StartupTasks();
}
/// <summary>
/// Perform any common startup tasks. Runs after <see cref="Prepare(bool)"/>.
/// Perform any common clean-up tasks. Should be run when idle, or whenever necessary.
/// </summary>
protected virtual void StartupTasks()
public virtual void Cleanup()
{
}
+1 -7
View File
@@ -38,12 +38,6 @@ namespace osu.Game.IO
}
}
protected override void StartupTasks()
{
base.StartupTasks();
deletePending();
}
public FileInfo Add(Stream data, bool reference = true)
{
var context = GetContext();
@@ -101,7 +95,7 @@ namespace osu.Game.IO
context.SaveChanges();
}
private void deletePending()
public override void Cleanup()
{
var context = GetContext();
+2
View File
@@ -160,6 +160,8 @@ namespace osu.Game
};
API.Register(this);
FileStore.Cleanup();
}
private WorkingBeatmap lastBeatmap;