From 9bb48e350c79451598a2c9d195d519652c9bdc61 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Mon, 25 Feb 2019 11:37:27 +0000 Subject: Set up recurring job --- Main/Startup.cs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'Main/Startup.cs') 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( + x => x.Start(Configuration.GetConnectionString("Aggregator")), + Cron.HourInterval(3) ); } } -- cgit v1.2.3-13-gbd6f