Skip to content

Commit

Permalink
fix: clear queue after tvdb removal
Browse files Browse the repository at this point in the history
a bit late for most daily users, but this is for the next stable.
  • Loading branch information
revam committed Oct 20, 2024
1 parent d72f0b1 commit 355183d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Shoko.Server/Databases/DatabaseFixes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -819,4 +819,10 @@ public static void CleanupAfterRemovingTvDB()
if (dir.Exists)
dir.Delete(true);
}

public static void ClearQuartzQueue()
{
var queueHandler = Utils.ServiceContainer.GetRequiredService<QueueHandler>();
queueHandler.Clear().ConfigureAwait(false).GetAwaiter().GetResult();
}
}
1 change: 1 addition & 0 deletions Shoko.Server/Databases/MySQL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,7 @@ public class MySQL : BaseDatabase<MySqlConnection>
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;");
Expand Down
1 change: 1 addition & 0 deletions Shoko.Server/Databases/SQLServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions Shoko.Server/Databases/SQLite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool, string> MigrateRenamers(object connection)
Expand Down

0 comments on commit 355183d

Please sign in to comment.