diff --git a/Shoko.Server/Databases/DatabaseFixes.cs b/Shoko.Server/Databases/DatabaseFixes.cs index 3dde8a50b..37647919b 100644 --- a/Shoko.Server/Databases/DatabaseFixes.cs +++ b/Shoko.Server/Databases/DatabaseFixes.cs @@ -819,4 +819,10 @@ public static void CleanupAfterRemovingTvDB() if (dir.Exists) dir.Delete(true); } + + public static void ClearQuartzQueue() + { + var queueHandler = Utils.ServiceContainer.GetRequiredService(); + queueHandler.Clear().ConfigureAwait(false).GetAwaiter().GetResult(); + } } diff --git a/Shoko.Server/Databases/MySQL.cs b/Shoko.Server/Databases/MySQL.cs index 26a048940..588499569 100644 --- a/Shoko.Server/Databases/MySQL.cs +++ b/Shoko.Server/Databases/MySQL.cs @@ -848,6 +848,7 @@ public class MySQL : BaseDatabase new(139, 9, "ALTER TABLE Trakt_Show DROP COLUMN TvDB_ID;"), new(139, 10, "ALTER TABLE Trakt_Show ADD COLUMN TmdbShowID INT NULL;"), new(139, 11, DatabaseFixes.CleanupAfterRemovingTvDB), + new(139, 12, DatabaseFixes.ClearQuartzQueue), }; private DatabaseCommand linuxTableVersionsFix = new("RENAME TABLE versions TO Versions;"); diff --git a/Shoko.Server/Databases/SQLServer.cs b/Shoko.Server/Databases/SQLServer.cs index ec8ccbdfa..45aa05dc7 100644 --- a/Shoko.Server/Databases/SQLServer.cs +++ b/Shoko.Server/Databases/SQLServer.cs @@ -778,6 +778,7 @@ public override bool HasVersionsTable() new DatabaseCommand(131, 9, "ALTER TABLE Trakt_Show DROP COLUMN TvDB_ID;"), new DatabaseCommand(131, 10, "ALTER TABLE Trakt_Show ADD TmdbShowID INT NULL;"), new DatabaseCommand(131, 11, DatabaseFixes.CleanupAfterRemovingTvDB), + new DatabaseCommand(131, 12, DatabaseFixes.ClearQuartzQueue), }; private static void AlterImdbMovieIDType() diff --git a/Shoko.Server/Databases/SQLite.cs b/Shoko.Server/Databases/SQLite.cs index 5a97a4efb..fa3661948 100644 --- a/Shoko.Server/Databases/SQLite.cs +++ b/Shoko.Server/Databases/SQLite.cs @@ -773,6 +773,7 @@ public override void CreateDatabase() new(123, 9, "ALTER TABLE Trakt_Show DROP COLUMN TvDB_ID;"), new(123, 10, "ALTER TABLE Trakt_Show ADD COLUMN TmdbShowID INTEGER NULL;"), new(123, 11, DatabaseFixes.CleanupAfterRemovingTvDB), + new(123, 12, DatabaseFixes.ClearQuartzQueue), }; private static Tuple MigrateRenamers(object connection)