diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs index 5168422c..b96287e9 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs @@ -1,4 +1,5 @@ using System.Text.RegularExpressions; +using Coravel; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc.ApplicationModels; @@ -21,9 +22,13 @@ public class Startup JobHostdService.AddService(services); services.AddSingleton(); services.AddHostedService(o => o.GetRequiredService()); + services.AddScheduler(); services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); services.AddRouting(options => options.ConstraintMap["slugify"] = typeof(SlugifyParameterTransformer)); services.AddMvc(options => options.Conventions.Add(new RouteTokenTransformerConvention(new SlugifyParameterTransformer()))); services.AddApplication(); @@ -44,6 +49,15 @@ public class Startup { app.UseRouting(); app.UseEndpoints(endpoints => endpoints.MapHub("/api/hub")); + app.ApplicationServices.UseScheduler(scheduler => + { + //scheduler.Schedule().EveryMinute(); + //scheduler.Schedule().EveryMinute(); + scheduler.Schedule().EveryMinute(); + scheduler.Schedule().EveryMinute(); + scheduler.Schedule().EveryMinute(); + scheduler.Schedule().EveryMinute(); + }); var contentTypeProvider = new FileExtensionContentTypeProvider(); contentTypeProvider.Mappings.Add(".mjs", "text/javascript"); app.UseStaticFiles(new StaticFileOptions { ContentTypeProvider = contentTypeProvider });