public IActionResult SincAll() { _phoebusService.RequestPhoebus(DateTime.Now); _intermeioService.GetAllBaseIntermeio(); _analiseService.ValidationAnalise(); return(RedirectToAction("Index")); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, IPhoebusService phoebusService, IIntermeioService intermeioService) { phoebusService.RequestPhoebus(DateTime.Now); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); //app.UseDatabaseErrorPage(); } else { //app.UseExceptionHandler("/Home/Error"); //// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); //app.UseCookiePolicy(); //app.UseAuthentication(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, IPhoebusService _phoebusService, IIntermeioService _intermeioService, IAnaliseService _analiseService, IPosService _posService, IExtratoService _extratoService) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } // app.UseHttpsRedirection(); app.UseHangfireDashboard(); app.UseCors(x => x.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader()); app.UseAuthentication(); app.UseMvc(); #region Background Jobs HangFire BackgroundJob.Schedule(() => _phoebusService.RequestPhoebus(DateTime.Now, "00:00:00", "23:59:59"), TimeSpan.FromMinutes(60)); RecurringJob.AddOrUpdate(() => _intermeioService.GetAllBaseIntermeio(), Cron.Daily(12, 30)); RecurringJob.AddOrUpdate(() => _analiseService.ValidationAnalise(), Cron.Daily(12, 30)); RecurringJob.AddOrUpdate(() => _posService.RequestPosByIntermeio(), Cron.Daily(12, 30)); RecurringJob.AddOrUpdate(() => _extratoService.ValidationAluguel(), Cron.Daily(12, 30)); #endregion }