mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 08:49:59 +09:00
Run cleanup tasks only on startup via manual calls
This commit is contained in:
@ -104,6 +104,8 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
if (importHost != null)
|
if (importHost != null)
|
||||||
ipc = new BeatmapIPCChannel(importHost, this);
|
ipc = new BeatmapIPCChannel(importHost, this);
|
||||||
|
|
||||||
|
beatmaps.Cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -40,12 +40,6 @@ namespace osu.Game.Beatmaps
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void StartupTasks()
|
|
||||||
{
|
|
||||||
base.StartupTasks();
|
|
||||||
cleanupPendingDeletions();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Add a <see cref="BeatmapSetInfo"/> to the database.
|
/// Add a <see cref="BeatmapSetInfo"/> to the database.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -136,7 +130,7 @@ namespace osu.Game.Beatmaps
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void cleanupPendingDeletions()
|
public override void Cleanup()
|
||||||
{
|
{
|
||||||
var context = GetContext();
|
var context = GetContext();
|
||||||
|
|
||||||
|
@ -27,14 +27,12 @@ namespace osu.Game.Database
|
|||||||
Logger.Error(e, $@"Failed to initialise the {GetType()}! Trying again with a clean database...");
|
Logger.Error(e, $@"Failed to initialise the {GetType()}! Trying again with a clean database...");
|
||||||
Prepare(true);
|
Prepare(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
StartupTasks();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <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>
|
/// </summary>
|
||||||
protected virtual void StartupTasks()
|
public virtual void Cleanup()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,12 +38,6 @@ namespace osu.Game.IO
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void StartupTasks()
|
|
||||||
{
|
|
||||||
base.StartupTasks();
|
|
||||||
deletePending();
|
|
||||||
}
|
|
||||||
|
|
||||||
public FileInfo Add(Stream data, bool reference = true)
|
public FileInfo Add(Stream data, bool reference = true)
|
||||||
{
|
{
|
||||||
var context = GetContext();
|
var context = GetContext();
|
||||||
@ -101,7 +95,7 @@ namespace osu.Game.IO
|
|||||||
context.SaveChanges();
|
context.SaveChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void deletePending()
|
public override void Cleanup()
|
||||||
{
|
{
|
||||||
var context = GetContext();
|
var context = GetContext();
|
||||||
|
|
||||||
|
@ -160,6 +160,8 @@ namespace osu.Game
|
|||||||
};
|
};
|
||||||
|
|
||||||
API.Register(this);
|
API.Register(this);
|
||||||
|
|
||||||
|
FileStore.Cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
private WorkingBeatmap lastBeatmap;
|
private WorkingBeatmap lastBeatmap;
|
||||||
|
Reference in New Issue
Block a user