startup 改回判斷正式/測試環境

This commit is contained in:
cesar liu 2022-08-08 11:44:12 +08:00
parent 782ddaf512
commit c51a80b199
3 changed files with 6 additions and 6 deletions

View File

@ -96,13 +96,13 @@ namespace SolarPower
#region #region
//services.AddHostedService<OperationScheduleBackgroundService>(); //services.AddHostedService<OperationScheduleBackgroundService>();
//if (envName == "Production") //if (envName == "Production")
//if (envName != "Production") if (envName != "Production")
//{ {
////添加Quartz服務 ////添加Quartz服務
services.AddSingleton<IJobFactory, SingletonJobFactory>(); services.AddSingleton<IJobFactory, SingletonJobFactory>();
services.AddSingleton<ISchedulerFactory, StdSchedulerFactory>(); services.AddSingleton<ISchedulerFactory, StdSchedulerFactory>();
////添加Job ////添加Job
//#region ©w´Á­pµe //#region ©w´Á­pµe / ¨C¤é email ³øªíªA°È
services.AddSingleton<OperationScheduleJob>(); services.AddSingleton<OperationScheduleJob>();
services.AddSingleton( services.AddSingleton(
new JobSchedule(jobType: typeof(OperationScheduleJob), cronExpression: Configuration.GetValue<string>("BackgroundServiceCron:OperationScheduleJob")) new JobSchedule(jobType: typeof(OperationScheduleJob), cronExpression: Configuration.GetValue<string>("BackgroundServiceCron:OperationScheduleJob"))
@ -147,7 +147,7 @@ namespace SolarPower
//#endregion //#endregion
services.AddHostedService<QuartzHostedService>(); services.AddHostedService<QuartzHostedService>();
//} }
#endregion #endregion
services.AddApplicationInsightsTelemetry(); services.AddApplicationInsightsTelemetry();

View File

@ -35,7 +35,7 @@
"Password": "8WMHBEWuT0XoAB4kzduQHA==" "Password": "8WMHBEWuT0XoAB4kzduQHA=="
}, },
"BackgroundServiceCron": { "BackgroundServiceCron": {
"CalcPowerStationJob": "0 14 * * * ?", "CalcPowerStationJob": "0 05 * * * ?",
"CalcAvgPowerStationJob": "0 12 0 * * ?", "CalcAvgPowerStationJob": "0 12 0 * * ?",
"OperationScheduleJob": "0 0 8 * * ?", "OperationScheduleJob": "0 0 8 * * ?",
"CalcInverter15minJob": "0 2/15 * * * ?", "CalcInverter15minJob": "0 2/15 * * * ?",

View File

@ -57,7 +57,7 @@ namespace solarApp
private void fmArchive_Load(object sender, EventArgs e) private void fmArchive_Load(object sender, EventArgs e)
{ {
MessageBox.Show(" loading "); // MessageBox.Show(" loading ");
#region #region
int i = 0; int i = 0;
var site_list = stationSvc.get_station_list(); var site_list = stationSvc.get_station_list();