Skip to content

Commit 965af59

Browse files
committed
[修改]1. 修改处理器监控的字段名称定义
1 parent 36f91d0 commit 965af59

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

GameFrameX.Core/BaseHandler/BaseMessageHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ public virtual async Task InnerAction(int timeout = 30000, CancellationToken can
8989
/// <returns>动作执行任务</returns>
9090
protected async Task InnerActionAsync()
9191
{
92-
if (GlobalSettings.CurrentSetting.IsTimeOut)
92+
if (GlobalSettings.CurrentSetting.IsMonitorTimeOut)
9393
{
9494
_stopwatch.Restart();
9595
await ActionAsync();
9696
_stopwatch.Stop();
97-
if (_stopwatch.Elapsed.Seconds >= GlobalSettings.CurrentSetting.TimeOutSeconds)
97+
if (_stopwatch.Elapsed.Seconds >= GlobalSettings.CurrentSetting.MonitorTimeOutSeconds)
9898
{
9999
LogHelper.Warn($"消息处理器:{GetType().Name},UniqueId:{Message.UniqueId} 执行耗时:{_stopwatch.ElapsedMilliseconds} ms");
100100
}

GameFrameX.StartUp/Options/LauncherOptions.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,20 @@ public sealed class LauncherOptions
4848
/// <summary>
4949
/// 是否监控打印超时日志
5050
/// </summary>
51-
[Option(nameof(IsMonitorTimeOut), Default = false, HelpText = "是否打印超时日志,默认值为false")]
52-
public bool IsMonitorTimeOut { get; set; }
51+
[Option(nameof(IsMonitorMessageTimeOut), Default = false, HelpText = "是否打印超时日志,默认值为false")]
52+
public bool IsMonitorMessageTimeOut { get; set; }
5353

5454
/// <summary>
5555
/// 监控处理器超时时间(秒),默认值为1秒,只有IsMonitorTimeOut为true时有效
5656
/// </summary>
57-
[Option(nameof(MonitorTimeOutSeconds), Default = 1, HelpText = "处理器超时时间(秒),默认值为1秒,只有IsMonitorTimeOut为true时有效")]
58-
public int MonitorTimeOutSeconds { get; set; }
57+
[Option(nameof(MonitorMessageTimeOutSeconds), Default = 1, HelpText = "处理器超时时间(秒),默认值为1秒,只有IsMonitorMessageTimeOut为true时有效")]
58+
public int MonitorMessageTimeOutSeconds { get; set; }
59+
60+
/// <summary>
61+
/// 网络发送等待超时时间(秒),默认值为5秒
62+
/// </summary>
63+
[Option(nameof(NetWorkSendTimeOutSeconds), Default = 5, HelpText = "网络发送等待超时时间(秒),默认值为5秒,最小值为1秒")]
64+
public int NetWorkSendTimeOutSeconds { get; set; }
5965

6066
/// <summary>
6167
/// 是否是Debug打印日志模式,默认值为false

GameFrameX.Utility/Setting/AppSetting.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,17 @@ public string ToFormatString()
151151
/// <summary>
152152
/// 是否打印超时日志,
153153
/// </summary>
154-
public bool IsTimeOut { get; set; }
154+
public bool IsMonitorTimeOut { get; set; }
155155

156156
/// <summary>
157157
/// 处理器超时时间(秒),默认值为1秒
158158
/// </summary>
159-
public int TimeOutSeconds { get; set; }
159+
public int MonitorTimeOutSeconds { get; set; }
160+
161+
/// <summary>
162+
/// 网络发送等待超时时间(秒),默认值为5秒
163+
/// </summary>
164+
public int NetWorkSendTimeOutSeconds { get; set; }
160165

161166
/// <summary>
162167
/// 是否打印发送数据,只有在IsDebug为true时有效,默认值为false

0 commit comments

Comments
 (0)