summaryrefslogtreecommitdiffstats
path: root/server/src/Jobs/JobRegister.cs
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/Jobs/JobRegister.cs')
-rw-r--r--server/src/Jobs/JobRegister.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/server/src/Jobs/JobRegister.cs b/server/src/Jobs/JobRegister.cs
new file mode 100644
index 0000000..72c2cc7
--- /dev/null
+++ b/server/src/Jobs/JobRegister.cs
@@ -0,0 +1,18 @@
+using Quartz;
+
+namespace IOL.GreatOffice.Api.Jobs;
+
+public static class JobRegister
+{
+ public static readonly JobKey TokenCleanupKey = new("TokenCleanupJob");
+
+ public static IServiceCollectionQuartzConfigurator RegisterJobs(this IServiceCollectionQuartzConfigurator configurator) {
+ configurator.AddJob<TokenCleanupJob>(TokenCleanupKey);
+ configurator.AddTrigger(options => {
+ options.ForJob(TokenCleanupKey)
+ .WithIdentity(TokenCleanupKey.Name + "-trigger")
+ .WithCronSchedule(CronScheduleBuilder.DailyAtHourAndMinute(1, 0));
+ });
+ return configurator;
+ }
+}