Skip to content

Commit

Permalink
AccessTokenContainer.RegisterAsync() 方法中添统一加 ConfigureAwait(false) 标记 #…
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreySu committed Sep 16, 2022
1 parent 4bf97cc commit c333580
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ and limitations under the License.
修改标识:Senparc - 20190929
修改描述:v16.9.101 优化 Container 异步注册方法
修改标识:Senparc - 20220916
修改描述:16.18.6.1 RegisterAsync() 方法添加 ConfigureAwait(false) 标记
----------------------------------------------------------------*/

/* 异步单元测试:https://github.com/OpenSenparc/UnitTestBasket/blob/10017bff083223f63ee11c7b31c818b8c204f30d/UnitTestBasket/ThreadAndAsyncTests/FuncAsyncTests.cs#L17 */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net462;netstandard2.0;netstandard2.1</TargetFrameworks>
<Version>16.18.6</Version>
<Version>16.18.6.1</Version>
<AssemblyName>Senparc.Weixin.MP</AssemblyName>
<RootNamespace>Senparc.Weixin.MP</RootNamespace>
<GeneratePackageOnBuild Condition=" '$(Configuration)' == 'Release' ">true</GeneratePackageOnBuild>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,8 @@ public static UpdateTaskCardResultJson UpdateTaskCard(string accessTokenOrAppKey
return Senparc.Weixin.CommonAPIs.CommonJsonSend.Send<UpdateTaskCardResultJson>(accessToken, _taskUrlFormat, data, CommonJsonSendType.POST, timeOut, jsonSetting: jsonSetting);
}, accessTokenOrAppKey);

}

#endregion

#region 异步方法
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ and limitations under the License.
修改标识:Senparc - 20210719
修改描述:v3.11.2 AccessTokenContainer 支持分布式同步锁
修改标识:Senparc - 20220916
修改描述:v3.15.8.1 RegisterAsync() 方法添加 ConfigureAwait(false) 标记
----------------------------------------------------------------*/

using System;
Expand Down Expand Up @@ -358,7 +361,7 @@ public static async Task RegisterAsync(string corpId, string corpSecret, string

var registerProviderTask = ProviderTokenContainer.RegisterAsync(corpId, corpSecret);//连带注册ProviderTokenContainer

await Task.WhenAll(new[] { registerTask, registerJsApiTask, registerProviderTask });//等待所有任务完成
await Task.WhenAll(new[] { registerTask, registerJsApiTask, registerProviderTask }).ConfigureAwait(false);//等待所有任务完成
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFrameworks>net462;netstandard2.0;netstandard2.1</TargetFrameworks>
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net35'">$(Net35FrameworkPathOverride)</FrameworkPathOverride>
<Version>3.15.8-beta1</Version>
<Version>3.15.8.1</Version>
<LangVersion>10.0</LangVersion>
<AssemblyName>Senparc.Weixin.Work</AssemblyName>
<RootNamespace>Senparc.Weixin.Work</RootNamespace>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ and limitations under the License.
修改标识:gokeiyou - 20201230
修改描述:新建 WxOpen 专属的 AccessTokenContainer
修改标识:Senparc - 20220916
修改描述:v3.15.7.1 RegisterAsync() 方法添加 ConfigureAwait(false) 标记
----------------------------------------------------------------*/

using Senparc.CO2NET.Extensions;
Expand Down Expand Up @@ -178,7 +181,7 @@ public static async Task RegisterAsync(string wxOpenAppId, string wxOpenAppSecre
Senparc.Weixin.Config.SenparcWeixinSetting.Items[name].WxOpenAppSecret = wxOpenAppSecret;
}

await Task.WhenAll(new[] { registerTask });//等待所有任务完成
await Task.WhenAll(new[] { registerTask }).ConfigureAwait(false);//等待所有任务完成
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net462;netstandard2.0;netstandard2.1</TargetFrameworks>
<Version>3.15.7</Version>
<Version>3.15.7.1</Version>
<LangVersion>9.0</LangVersion>
<AssemblyName>Senparc.Weixin.WxOpen</AssemblyName>
<RootNamespace>Senparc.Weixin.WxOpen</RootNamespace>
Expand Down

0 comments on commit c333580

Please sign in to comment.