mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-30 03:13:17 +01:00
update db queries
This commit is contained in:
34
MediaBrowser.Server.Startup.Common/Migrations/DbMigration.cs
Normal file
34
MediaBrowser.Server.Startup.Common/Migrations/DbMigration.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Common.ScheduledTasks;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Server.Implementations.Persistence;
|
||||
|
||||
namespace MediaBrowser.Server.Startup.Common.Migrations
|
||||
{
|
||||
public class DbMigration : IVersionMigration
|
||||
{
|
||||
private readonly IServerConfigurationManager _config;
|
||||
private readonly ITaskManager _taskManager;
|
||||
|
||||
public DbMigration(IServerConfigurationManager config, ITaskManager taskManager)
|
||||
{
|
||||
_config = config;
|
||||
_taskManager = taskManager;
|
||||
}
|
||||
|
||||
public void Run()
|
||||
{
|
||||
if (_config.Configuration.MigrationVersion < CleanDatabaseScheduledTask.MigrationVersion)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await Task.Delay(2000).ConfigureAwait(false);
|
||||
|
||||
_taskManager.QueueScheduledTask<CleanDatabaseScheduledTask>();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user