From 574ed2b1fab91f21cc6a3be8d8b6064e69fe36d8 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Sat, 26 Sep 2020 13:18:32 -0500 Subject: [PATCH] =?UTF-8?q?fix(archival):=20=F0=9F=90=9B=20restore=20AddOr?= =?UTF-8?q?UpdateRecurringJob?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scheduling/ScheduleMediator.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/Archival/FilterLists.Archival.Infrastructure/Scheduling/ScheduleMediator.cs b/services/Archival/FilterLists.Archival.Infrastructure/Scheduling/ScheduleMediator.cs index c8e20e69f..64ebce7d0 100644 --- a/services/Archival/FilterLists.Archival.Infrastructure/Scheduling/ScheduleMediator.cs +++ b/services/Archival/FilterLists.Archival.Infrastructure/Scheduling/ScheduleMediator.cs @@ -19,6 +19,11 @@ public static void ScheduleBackgroundJob(this IRequest request, TimeSpan delay) { BackgroundJob.Schedule(m => m.Send(request, CancellationToken.None), delay); } + + public static void AddOrUpdateRecurringJob(this IRequest request, Func cronExpression) + { + RecurringJob.AddOrUpdate(m => m.Send(request, CancellationToken.None), cronExpression); + } } internal static class HangfireExtension