|
|
@@ -15,7 +15,7 @@ public class S8ActiveFlowWatchService : ITransient
|
|
|
public const string AlertChannel = "s8-active-flow-stuck";
|
|
|
public const string AlertChannelOrphan = "s8-orphan-flow-instance";
|
|
|
|
|
|
- private static readonly string[] S8FlowBizTypes = new[] { "EXCEPTION_ESCALATION", "EXCEPTION_CLOSURE" };
|
|
|
+ public static readonly string[] S8FlowBizTypes = new[] { "EXCEPTION_ESCALATION", "EXCEPTION_CLOSURE" };
|
|
|
|
|
|
private readonly SqlSugarRepository<AdoS8Exception> _exceptionRep;
|
|
|
private readonly SqlSugarRepository<AdoS8NotificationLog> _notificationLogRep;
|
|
|
@@ -144,8 +144,10 @@ public class S8ActiveFlowWatchService : ITransient
|
|
|
int thresholdHours,
|
|
|
CancellationToken cancellationToken)
|
|
|
{
|
|
|
+ // 本地副本:SqlSugar 表达式树不允许直接引用静态/私有字段,必须先拷到 lambda 闭包变量。
|
|
|
+ var bizTypes = S8FlowBizTypes;
|
|
|
var candidates = await _flowInstanceRep.AsQueryable()
|
|
|
- .Where(fi => S8FlowBizTypes.Contains(fi.BizType)
|
|
|
+ .Where(fi => bizTypes.Contains(fi.BizType)
|
|
|
&& fi.Status == FlowInstanceStatusEnum.Running
|
|
|
&& fi.StartTime < staleBefore)
|
|
|
.OrderBy(fi => fi.StartTime, OrderByType.Asc)
|