Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
linzhiqiang committed May 3, 2021
1 parent 16a1cdf commit a31e304
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
13 changes: 11 additions & 2 deletions examples/Aix.ScheduleTask.Example/Program.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using System;
using System.Threading;

namespace Aix.ScheduleTask.Example
{
class Program
{
static void Main(string[] args)
{
ThreadPool.SetMinThreads(200, 200);
CreateHostBuilder(args).Build().Run();
}

Expand All @@ -18,7 +21,13 @@ public static IHostBuilder CreateHostBuilder(string[] args)
})
.ConfigureAppConfiguration((hostBulderContext, configurationBuilder) =>
{

//配置环境变量 ASPNETCORE _ENVIRONMENT: Development/Staging/Production(默认值)
//以下加载配置文件的方式,是系统的默认行为,如果改变配置文件路径 需要自己加载,否则没必要了
/*
var environmentName = hostBulderContext.HostingEnvironment.EnvironmentName;
configurationBuilder.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
configurationBuilder.AddJsonFile($"appsettings.{environmentName}.json", optional: true, reloadOnChange: true);// 覆盖前面的相同内容
*/
})
.ConfigureLogging((hostBulderContext, loggingBuilder) =>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"desc": "我是开发环境的配置,会覆盖appsettings.json中的相同配置"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{

"desc": "我是正式环境的配置,会覆盖appsettings.json中的相同配置"
}
2 changes: 1 addition & 1 deletion examples/Aix.ScheduleTask.Example/appsettings.Staging.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{

"desc": "我是测试环境的配置,会覆盖appsettings.json中的相同配置"
}
1 change: 1 addition & 0 deletions examples/Aix.ScheduleTask.Example/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"desc": "ÎÒÊǹ²ÓÃÅäÖÃ",
"connectionStrings": {
"master": "Server=.;Database=aixscheduletask;User ID=sa;Password=Sa123456;Max Pool Size=1000;Packet Size=32768;MultipleActiveResultSets=true;",
"master1": "server=192.168.102.108;port=3306;database=demo;uid=admin;pwd=CgTbMMiaWntK2#;charset=utf8mb4;Connection Timeout=18000;SslMode=none;"
Expand Down

0 comments on commit a31e304

Please sign in to comment.