From ae5be31c89fd7446a5e20bebd9b3cf30fca6a64d Mon Sep 17 00:00:00 2001 From: glax Date: Sat, 2 Sep 2023 14:49:31 +0200 Subject: [PATCH] Fixed Jobs/StartNow --- Tranga/Jobs/Job.cs | 6 ++++++ Tranga/Jobs/JobBoss.cs | 1 + 2 files changed, 7 insertions(+) diff --git a/Tranga/Jobs/Job.cs b/Tranga/Jobs/Job.cs index d565ec1..010efb6 100644 --- a/Tranga/Jobs/Job.cs +++ b/Tranga/Jobs/Job.cs @@ -62,6 +62,12 @@ public abstract class Job : GlobalBase this.lastExecution = DateTime.Now; } + public void ExecuteNow() + { + ResetProgress(); + this.lastExecution = DateTime.UnixEpoch; + } + public void Cancel() { Log($"Cancelling {this}"); diff --git a/Tranga/Jobs/JobBoss.cs b/Tranga/Jobs/JobBoss.cs index 5cfe59f..4fa4cb5 100644 --- a/Tranga/Jobs/JobBoss.cs +++ b/Tranga/Jobs/JobBoss.cs @@ -130,6 +130,7 @@ public class JobBoss : GlobalBase Queue connectorJobQueue = mangaConnectorJobQueue[job.mangaConnector]; if(!connectorJobQueue.Contains(job)) connectorJobQueue.Enqueue(job); + job.ExecuteNow(); } public void AddJobsToQueue(IEnumerable jobs)