aboutsummaryrefslogtreecommitdiff
path: root/Main
diff options
context:
space:
mode:
authorAryadev Chavali <aryadevchavali1@gmail.com>2019-02-21 18:23:50 +0000
committerAryadev Chavali <aryadevchavali1@gmail.com>2019-02-21 18:23:50 +0000
commitbf0336c76e0147d824daefca2b2bcc49bf60e79a (patch)
treebf248440eb2be12ed3e11616367f29604500d010 /Main
parentb35e9070834a1ad6dfd68bb9a463e11badf5ad71 (diff)
downloadnewsaggregator-bf0336c76e0147d824daefca2b2bcc49bf60e79a.tar.gz
newsaggregator-bf0336c76e0147d824daefca2b2bcc49bf60e79a.tar.bz2
newsaggregator-bf0336c76e0147d824daefca2b2bcc49bf60e79a.zip
Added job of aggregator
Diffstat (limited to 'Main')
-rw-r--r--Main/Startup.cs6
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
}
}
}