duheng
2024-05-13 204947203275d5190b1a816cb091f368aea79ac1
WaterPredict/IStation.ChEr.WebApi.Predict/Startup.cs
@@ -1,5 +1,4 @@

using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Server.Kestrel.Core;
@@ -54,7 +53,6 @@
                c.UseInlineDefinitionsForEnums();
            }).AddMiniProfiler();
            services.AddJsonOptions(options =>
            {
                //返回属性大小写问题
@@ -71,10 +69,7 @@
            // SnowFlakeSingle.WorkId = 2;// Settings.SqlSugarParasHelper.SqlSugar.SnowFlakeWorkId;
            IStation.LogHelper.Info("log4net initial OK");
            //定时任务
            services.AddQuartz(q =>
@@ -91,14 +86,11 @@
                q.AddTrigger(opts => opts
                    .ForJob(jobKey) // link to the CalcWaterPredict
                    .WithIdentity("CalcWaterPredict-trigger") // give the trigger a unique name
                    .WithCronSchedule("0 06 0/1 * * ? ")); // 每小时一次,每次在该小时的06分开始执行:
                    .WithCronSchedule("0 02 0/1 * * ? ")); // 每小时一次,每次在该小时的06分开始执行:
            });
            // Add the Quartz.NET hosted service 
            services.AddQuartzHostedService(q => q.WaitForJobsToComplete = true);
        }
        /// <summary>
@@ -136,7 +128,7 @@
                FileProvider = new PhysicalFileProvider(path)//指定实际物理路径
            });
            #endregion
            #endregion 开放 data 文件夹(可以通过url访问文件)
            // Serilog请求日志中间件---必须在 UseStaticFiles 和 UseRouting 之间
            //app.UseSerilogRequestLogging();
@@ -168,12 +160,6 @@
                    name: "default",
                    pattern: "{controller=Home}/{action=Index}/{id?}");
            });
        }
    }
}