diff options
Diffstat (limited to 'Main/Startup.cs')
-rw-r--r-- | Main/Startup.cs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Main/Startup.cs b/Main/Startup.cs index e7d1161..2857e5b 100644 --- a/Main/Startup.cs +++ b/Main/Startup.cs @@ -10,7 +10,9 @@ using Microsoft.EntityFrameworkCore; using Hangfire;
using Hangfire.MySql.Core;
+
using Database;
+using Main.Jobs;
namespace Main {
public class Startup {
@@ -48,6 +50,10 @@ namespace Main { app.UseHangfireDashboard();
app.UseHangfireServer();
+
+ var context = app.ApplicationServices.GetService<DatabaseContext>();
+
+ RecurringJob.AddOrUpdate(() => AggregatorJob.Process(context), Cron.HourInterval(3)); // add database update as a job
}
}
}
|