diff options
author | Aryadev Chavali <aryadevchavali1@gmail.com> | 2019-02-25 11:37:27 +0000 |
---|---|---|
committer | Aryadev Chavali <aryadevchavali1@gmail.com> | 2019-02-25 11:37:27 +0000 |
commit | 9bb48e350c79451598a2c9d195d519652c9bdc61 (patch) | |
tree | dbc5b72ec5f9802249a3e8657999091e9f83b252 /Main/Startup.cs | |
parent | 496eb3a4252dce5e37c735b47b30927d1aa85a18 (diff) | |
download | newsaggregator-9bb48e350c79451598a2c9d195d519652c9bdc61.tar.gz newsaggregator-9bb48e350c79451598a2c9d195d519652c9bdc61.tar.bz2 newsaggregator-9bb48e350c79451598a2c9d195d519652c9bdc61.zip |
Set up recurring job
Diffstat (limited to 'Main/Startup.cs')
-rw-r--r-- | Main/Startup.cs | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/Main/Startup.cs b/Main/Startup.cs index 3932568..980e110 100644 --- a/Main/Startup.cs +++ b/Main/Startup.cs @@ -46,21 +46,14 @@ namespace Main { }
app.UseDefaultFiles();
- app.UseStaticFiles(new StaticFileOptions {
- FileProvider = new PhysicalFileProvider(
- Path.Combine(
- Directory.GetParent(Directory.GetCurrentDirectory()).ToString(),
- "Frontend"
- )
- )
- });
+ app.UseStaticFiles();
app.UseHangfireServer();
app.UseHangfireDashboard();
- RecurringJob.AddOrUpdate(
- () => System.Console.WriteLine("Job has been run!"),
- Cron.Minutely()
+ RecurringJob.AddOrUpdate<AggregatorJob>(
+ x => x.Start(Configuration.GetConnectionString("Aggregator")),
+ Cron.HourInterval(3)
);
}
}
|