From 38e744bb9c4be280a23d868b0a89e3451cccbf17 Mon Sep 17 00:00:00 2001 From: don Date: Tue, 23 Feb 2021 12:23:32 +0800 Subject: [PATCH] edit --- AmqpTest/AmqpTest.csproj | 3 ++- AmqpTest/Program.cs | 4 ++++ AmqpTest/Properties/launchSettings.json | 2 +- AmqpTest/appsettings.debug.json | 2 +- amqp_test_run.sh | 2 +- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/AmqpTest/AmqpTest.csproj b/AmqpTest/AmqpTest.csproj index bdfd545..17f7b23 100644 --- a/AmqpTest/AmqpTest.csproj +++ b/AmqpTest/AmqpTest.csproj @@ -1,4 +1,4 @@ - + netcoreapp3.1 @@ -14,6 +14,7 @@ + diff --git a/AmqpTest/Program.cs b/AmqpTest/Program.cs index b3c3ccd..40e4838 100644 --- a/AmqpTest/Program.cs +++ b/AmqpTest/Program.cs @@ -1,3 +1,4 @@ +using AmqpTest.Amqp; using AmqpTest.Configs; using AmqpTest.Logs; using Microsoft.Extensions.Configuration; @@ -66,6 +67,9 @@ namespace AmqpTest return setting; }; + + services.AddSingleton(); + services.AddHostedService(); }); } } diff --git a/AmqpTest/Properties/launchSettings.json b/AmqpTest/Properties/launchSettings.json index 2a0f023..a691a5a 100644 --- a/AmqpTest/Properties/launchSettings.json +++ b/AmqpTest/Properties/launchSettings.json @@ -3,7 +3,7 @@ "AmqpTest": { "commandName": "Project", "environmentVariables": { - "DOTNET_ENVIRONMENT": "Development" + "DOTNET_ENVIRONMENT": "debug" } }, "Docker": { diff --git a/AmqpTest/appsettings.debug.json b/AmqpTest/appsettings.debug.json index a18b619..986408b 100644 --- a/AmqpTest/appsettings.debug.json +++ b/AmqpTest/appsettings.debug.json @@ -4,7 +4,7 @@ "AccessKey": "LTAI4FdXhwy1evoHXingMaiZ", "AccessSecret": "CGmGpzta6ro8Bta4RLiQD18EF8m6Bm", "iotInstanceId": "iot-cn-nif1vosz501", - "ConsumerGroupId": "0ZQFQv0QreC7WALTEWad000100", //"bbQdnXQJIx2eCDjVbCIZ000100", // "hJBxHrxY51jZVhu6cCsQ000100", //"8GwMMBJUWz5PWaW0jtb6000100", + "ConsumerGroupId": "eQVdFouKAYajil208F7F000100", //"bbQdnXQJIx2eCDjVbCIZ000100", // "hJBxHrxY51jZVhu6cCsQ000100", //"8GwMMBJUWz5PWaW0jtb6000100", "RegionId": "cn-shanghai", "ProductKey": "a18mXM6Cvx8", "UId": "1111649216405698", diff --git a/amqp_test_run.sh b/amqp_test_run.sh index 14c6009..c0c78a7 100644 --- a/amqp_test_run.sh +++ b/amqp_test_run.sh @@ -12,7 +12,7 @@ elif [[ ${environment} == 'test' ]]; then docker rm amqp_test || true docker rmi -f $(docker images | grep 139.224.254.18:5000/amqp_test | awk '{print $3}') docker pull 139.224.254.18:5000/amqp_test:$version - docker run -d -e environment=test -v /home/data/amqp_test/log:/var/amqp/logs --restart=always --name amqp_test 139.224.254.18:5000/amqp_test:$version; + docker run -d -e environment=test -v /home/data/amqp_test/log:/var/amqp/logs --name amqp_test 139.224.254.18:5000/amqp_test:$version; #删除产生的None镜像 docker rmi -f $(docker images | grep none | awk '{print $3}') docker ps -a