mirror of
https://github.com/C9Glax/tranga-website.git
synced 2025-06-12 23:07:54 +02:00
33
Tranga/TrangaTasks/UpdateLibrariesTask.cs
Normal file
33
Tranga/TrangaTasks/UpdateLibrariesTask.cs
Normal file
@ -0,0 +1,33 @@
|
||||
using System.Net;
|
||||
using Logging;
|
||||
|
||||
namespace Tranga.TrangaTasks;
|
||||
|
||||
/// <summary>
|
||||
/// LEGACY DEPRECATED
|
||||
/// </summary>
|
||||
public class UpdateLibrariesTask : TrangaTask
|
||||
{
|
||||
public UpdateLibrariesTask(TimeSpan reoccurrence) : base(Task.UpdateLibraries, reoccurrence)
|
||||
{
|
||||
}
|
||||
|
||||
protected override HttpStatusCode ExecuteTask(TaskManager taskManager, Logger? logger, CancellationToken? cancellationToken = null)
|
||||
{
|
||||
if (cancellationToken?.IsCancellationRequested ?? false)
|
||||
return HttpStatusCode.RequestTimeout;
|
||||
foreach(LibraryManager lm in taskManager.settings.libraryManagers)
|
||||
lm.UpdateLibrary();
|
||||
return HttpStatusCode.OK;
|
||||
}
|
||||
|
||||
public override TrangaTask Clone()
|
||||
{
|
||||
return new UpdateLibrariesTask(this.reoccurrence);
|
||||
}
|
||||
|
||||
protected override double GetProgress()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user