feat: 更新实体增加sql过滤参数 (#140)

Co-authored-by: tk <fiyne1a@dingtalk.com>
This commit is contained in:
2024-06-11 18:10:02 +08:00
committed by GitHub
parent 608a1ded5c
commit a3ab97019d
10 changed files with 23 additions and 21 deletions

View File

@ -282,14 +282,14 @@ public sealed class JobService(BasicRepository<Sys_Job, long> rpo, IJobRecordSer
new Sys_Job { Status = JobStatues.Idle }, [nameof(Sys_Job.Status)], null
, a => a.Status == JobStatues.Running &&
a.LastExecTime < DateTime.Now.AddSeconds(-Numbers.SECS_TIMEOUT_JOB)
, true)
, null, true)
.ConfigureAwait(false);
var ret2 = await UpdateAsync( // 空闲中,下次执行时间在当前时间减去超时时间以前;将下次执行时间调整到现在
new Sys_Job { NextExecTime = DateTime.Now, NextTimeId = DateTime.Now.TimeUnixUtc() }
, [nameof(Sys_Job.NextExecTime), nameof(Sys_Job.NextTimeId)], null
, a => a.Status == JobStatues.Idle && a.NextExecTime < DateTime.Now.AddSeconds(-Numbers.SECS_TIMEOUT_JOB)
, true)
, null, true)
.ConfigureAwait(false);
return ret1 + ret2;
}