aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/ScheduledTasks/TaskManager.cs
diff options
context:
space:
mode:
authorShadowghost <Ghost_of_Stone@web.de>2024-09-04 17:38:10 +0200
committerShadowghost <Ghost_of_Stone@web.de>2024-09-04 17:38:10 +0200
commit08ed0a9a5d2a241abe4304e03fab4ae74291e3c9 (patch)
tree5e591bea0a6b2f9b8705aad7e5e44e1cb2768b5c /Emby.Server.Implementations/ScheduledTasks/TaskManager.cs
parent737a1b8a37e95bb4ed5e622d53209fa498239084 (diff)
Cleanup tasks
Diffstat (limited to 'Emby.Server.Implementations/ScheduledTasks/TaskManager.cs')
-rw-r--r--Emby.Server.Implementations/ScheduledTasks/TaskManager.cs49
1 files changed, 16 insertions, 33 deletions
diff --git a/Emby.Server.Implementations/ScheduledTasks/TaskManager.cs b/Emby.Server.Implementations/ScheduledTasks/TaskManager.cs
index 42c30c959..a5e4104ff 100644
--- a/Emby.Server.Implementations/ScheduledTasks/TaskManager.cs
+++ b/Emby.Server.Implementations/ScheduledTasks/TaskManager.cs
@@ -1,5 +1,3 @@
-#pragma warning disable CS1591
-
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
@@ -41,21 +39,16 @@ namespace Emby.Server.Implementations.ScheduledTasks
ScheduledTasks = Array.Empty<IScheduledTaskWorker>();
}
+ /// <inheritdoc />
public event EventHandler<GenericEventArgs<IScheduledTaskWorker>>? TaskExecuting;
+ /// <inheritdoc />
public event EventHandler<TaskCompletionEventArgs>? TaskCompleted;
- /// <summary>
- /// Gets the list of Scheduled Tasks.
- /// </summary>
- /// <value>The scheduled tasks.</value>
- public IScheduledTaskWorker[] ScheduledTasks { get; private set; }
+ /// <inheritdoc />
+ public IReadOnlyList<IScheduledTaskWorker> ScheduledTasks { get; private set; }
- /// <summary>
- /// Cancels if running and queue.
- /// </summary>
- /// <typeparam name="T">The task type.</typeparam>
- /// <param name="options">Task options.</param>
+ /// <inheritdoc />
public void CancelIfRunningAndQueue<T>(TaskOptions options)
where T : IScheduledTask
{
@@ -65,16 +58,14 @@ namespace Emby.Server.Implementations.ScheduledTasks
QueueScheduledTask<T>(options);
}
+ /// <inheritdoc />
public void CancelIfRunningAndQueue<T>()
where T : IScheduledTask
{
CancelIfRunningAndQueue<T>(new TaskOptions());
}
- /// <summary>
- /// Cancels if running.
- /// </summary>
- /// <typeparam name="T">The task type.</typeparam>
+ /// <inheritdoc />
public void CancelIfRunning<T>()
where T : IScheduledTask
{
@@ -82,11 +73,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
((ScheduledTaskWorker)task).CancelIfRunning();
}
- /// <summary>
- /// Queues the scheduled task.
- /// </summary>
- /// <typeparam name="T">The task type.</typeparam>
- /// <param name="options">Task options.</param>
+ /// <inheritdoc />
public void QueueScheduledTask<T>(TaskOptions options)
where T : IScheduledTask
{
@@ -102,12 +89,14 @@ namespace Emby.Server.Implementations.ScheduledTasks
}
}
+ /// <inheritdoc />
public void QueueScheduledTask<T>()
where T : IScheduledTask
{
QueueScheduledTask<T>(new TaskOptions());
}
+ /// <inheritdoc />
public void QueueIfNotRunning<T>()
where T : IScheduledTask
{
@@ -119,6 +108,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
}
}
+ /// <inheritdoc />
public void Execute<T>()
where T : IScheduledTask
{
@@ -144,11 +134,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
}
}
- /// <summary>
- /// Queues the scheduled task.
- /// </summary>
- /// <param name="task">The task.</param>
- /// <param name="options">The task options.</param>
+ /// <inheritdoc />
public void QueueScheduledTask(IScheduledTask task, TaskOptions options)
{
var scheduledTask = ScheduledTasks.FirstOrDefault(t => t.ScheduledTask.GetType() == task.GetType());
@@ -186,10 +172,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
}
}
- /// <summary>
- /// Adds the tasks.
- /// </summary>
- /// <param name="tasks">The tasks.</param>
+ /// <inheritdoc />
public void AddTasks(IEnumerable<IScheduledTask> tasks)
{
var list = tasks.Select(t => new ScheduledTaskWorker(t, _applicationPaths, this, _logger));
@@ -197,9 +180,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
ScheduledTasks = ScheduledTasks.Concat(list).ToArray();
}
- /// <summary>
- /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
- /// </summary>
+ /// <inheritdoc />
public void Dispose()
{
Dispose(true);
@@ -218,11 +199,13 @@ namespace Emby.Server.Implementations.ScheduledTasks
}
}
+ /// <inheritdoc />
public void Cancel(IScheduledTaskWorker task)
{
((ScheduledTaskWorker)task).Cancel();
}
+ /// <inheritdoc />
public Task Execute(IScheduledTaskWorker task, TaskOptions options)
{
return ((ScheduledTaskWorker)task).Execute(options);