From e66c76fc3405512b90735b5669278410f7974b1f Mon Sep 17 00:00:00 2001 From: JPVenson Date: Mon, 28 Apr 2025 03:18:08 +0300 Subject: Unified migration handling (#13950) --- .../Migrations/IAsyncMigrationRoutine.cs | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Jellyfin.Server/Migrations/IAsyncMigrationRoutine.cs (limited to 'Jellyfin.Server/Migrations/IAsyncMigrationRoutine.cs') diff --git a/Jellyfin.Server/Migrations/IAsyncMigrationRoutine.cs b/Jellyfin.Server/Migrations/IAsyncMigrationRoutine.cs new file mode 100644 index 0000000000..5b6a5fe942 --- /dev/null +++ b/Jellyfin.Server/Migrations/IAsyncMigrationRoutine.cs @@ -0,0 +1,31 @@ +using System; +using System.Threading; +using System.Threading.Tasks; + +namespace Jellyfin.Server.Migrations; + +/// +/// Interface that describes a migration routine. +/// +internal interface IAsyncMigrationRoutine +{ + /// + /// Execute the migration routine. + /// + /// A cancellation token triggered if the migration should be aborted. + /// A representing the asynchronous operation. + public Task PerformAsync(CancellationToken cancellationToken); +} + +/// +/// Interface that describes a migration routine. +/// +[Obsolete("Use IAsyncMigrationRoutine instead")] +internal interface IMigrationRoutine +{ + /// + /// Execute the migration routine. + /// + [Obsolete("Use IAsyncMigrationRoutine.PerformAsync instead")] + public void Perform(); +} -- cgit v1.2.3