Skip to content

Commit

Permalink
Merge pull request #102 from yrxx98/fixbug/job
Browse files Browse the repository at this point in the history
[fix]定时检测作业如定时器意外销毁了会重新启动
  • Loading branch information
nnhy authored Dec 21, 2024
2 parents 56e8b2c + 61798bc commit 12a4112
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions NewLife.CubeNC/Services/JobService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ public void Start()
var cmd = job.Method;
if (cmd.IsNullOrEmpty()) throw new ArgumentNullException(nameof(job.Method));

// 标识相同,不要处理。可能在运行过程中用户修改了作业参数
// 标识相同,不要处理。可能在运行过程中用户修改了作业参数 _timer.Id等于0表示定时器已销毁需要新启动。
var id = $"{expession}@{cmd}@{job.Argument}";
if (id == _id && _timer != null) return;
if (id == _id && _timer?.Id > 0) return;

foreach (var item in expession.Split(";"))
{
Expand Down

0 comments on commit 12a4112

Please sign in to comment.