diff options
author | Aryadev Chavali <aryadevchavali1@gmail.com> | 2019-02-21 18:23:50 +0000 |
---|---|---|
committer | Aryadev Chavali <aryadevchavali1@gmail.com> | 2019-02-21 18:23:50 +0000 |
commit | bf0336c76e0147d824daefca2b2bcc49bf60e79a (patch) | |
tree | bf248440eb2be12ed3e11616367f29604500d010 /Main/Startup.cs | |
parent | b35e9070834a1ad6dfd68bb9a463e11badf5ad71 (diff) | |
download | newsaggregator-bf0336c76e0147d824daefca2b2bcc49bf60e79a.tar.gz newsaggregator-bf0336c76e0147d824daefca2b2bcc49bf60e79a.tar.bz2 newsaggregator-bf0336c76e0147d824daefca2b2bcc49bf60e79a.zip |
Added job of aggregator
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
}
}
}
|