Added cleanup and database optimisation (#168)

This commit is contained in:
Michael Green
2023-10-18 17:52:46 +11:00
committed by GitHub
parent 7ae6eb82f0
commit ac97652683
4 changed files with 102 additions and 2 deletions

View File

@@ -48,6 +48,16 @@ if (Config.ReadSetting("API Key", "Test API Key") == "Test API Key")
Config.SetSetting("API Key", APIKey.ToString());
}
// clean up storage
if (Directory.Exists(Config.LibraryConfiguration.LibraryTempDirectory))
{
Directory.Delete(Config.LibraryConfiguration.LibraryTempDirectory, true);
}
if (Directory.Exists(Config.LibraryConfiguration.LibraryUploadDirectory))
{
Directory.Delete(Config.LibraryConfiguration.LibraryUploadDirectory, true);
}
// kick off any delayed upgrade tasks
// run 1002 background updates in the background on every start
DatabaseMigration.BackgroundUpgradeTargetSchemaVersions.Add(1002);
@@ -229,7 +239,14 @@ ProcessQueue.QueueItems.Add(new ProcessQueue.QueueItem(
ProcessQueue.QueueItemType.LibraryScan
})
);
ProcessQueue.QueueItems.Add(new ProcessQueue.QueueItem(
ProcessQueue.QueueItemType.Maintainer,
10080,
new List<ProcessQueue.QueueItemType>
{
ProcessQueue.QueueItemType.All
})
);
Logging.WriteToDiskOnly = false;