Skip to content

Commit b6a2180

Browse files
committed
[修改]1. 修改处理器计时的实现异常
1 parent dbcbe8a commit b6a2180

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

GameFrameX.Core/BaseHandler/BaseMessageHandler.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,30 +87,27 @@ public virtual async Task InnerAction(int timeout = 30000, CancellationToken can
8787
/// 记录执行时间并调用 <see cref="ActionAsync" />
8888
/// </summary>
8989
/// <returns>动作执行任务</returns>
90-
protected Task InnerActionAsync()
90+
protected async Task InnerActionAsync()
9191
{
9292
if (GlobalSettings.IsDebug)
9393
{
9494
_stopwatch.Restart();
95-
var result = ActionAsync();
95+
await ActionAsync();
9696
_stopwatch.Stop();
9797
LogHelper.Debug($"消息处理器:{GetType().Name},UniqueId:{Message.UniqueId} 执行耗时:{_stopwatch.ElapsedMilliseconds} ms");
98-
return result;
9998
}
10099

101100
if (GlobalSettings.IsMonitorTimeOut)
102101
{
103102
_stopwatch.Restart();
104-
var result = ActionAsync();
103+
await ActionAsync();
105104
_stopwatch.Stop();
106105
if (_stopwatch.Elapsed.Seconds >= GlobalSettings.MonitorTimeOutSeconds)
107106
{
108107
LogHelper.Warn($"消息处理器:{GetType().Name},UniqueId:{Message.UniqueId} 执行耗时:{_stopwatch.ElapsedMilliseconds} ms");
109108
}
110-
111-
return result;
112109
}
113110

114-
return ActionAsync();
111+
await ActionAsync();
115112
}
116113
}

0 commit comments

Comments
 (0)