Skip to content

Commit

Permalink
增加服务管理线程资源监控时间间隔配置项
Browse files Browse the repository at this point in the history
  • Loading branch information
andywu188 committed May 27, 2024
1 parent 40e68e5 commit 89f3c1f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion NewLife.Agent/CommandHandler/WatchDog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public override void Process(String[] args)

/// <summary>检查看门狗。</summary>
/// <remarks>
/// XAgent看门狗功能由管理线程完成,每分钟一次
/// XAgent看门狗功能由管理线程完成。
/// 检查指定的任务是否已经停止,如果已经停止,则启动它。
/// </remarks>
public virtual void CheckWatchDog()
Expand Down
2 changes: 1 addition & 1 deletion NewLife.Agent/ServiceBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ internal void DoLoop()
XTrace.WriteException(ex);
}

_event.WaitOne(10_000);
_event.WaitOne(set.WatchInterval * 1000);
}

_event.Dispose();
Expand Down
6 changes: 5 additions & 1 deletion NewLife.Agent/Setting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ public class Setting : Config<Setting>

/// <summary>使用自动运行。在Windows系统上,自动运行是登录后在桌面运行,而不使用后台服务。默认false</summary>
[Description("使用自动运行。在Windows系统上,自动运行是登录后在桌面运行,而不使用后台服务。默认false")]
public Boolean UseAutorun { get; set; }
public Boolean UseAutorun { get; set; }

/// <summary>服务管理线程资源监控时间间隔。多久检测一次服务资源占用情况。默认10秒</summary>
[Description("服务管理线程资源监控时间间隔。多久检测一次服务资源占用情况。默认10秒")]
public Int32 WatchInterval { get; set; } = 10;

/// <summary>最大占用内存。超过最大占用时,整个服务进程将会重启,以释放资源。默认0M</summary>
[Description("最大占用内存。超过最大占用时,整个服务进程将会重启,以释放资源。默认0M")]
Expand Down

0 comments on commit 89f3c1f

Please sign in to comment.