fix: 减少where 条件
This commit is contained in:
@@ -222,7 +222,6 @@ public class AssignmentService : IAssignmentService
|
|||||||
.Select((x, f) => f.AcsValue)
|
.Select((x, f) => f.AcsValue)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
var all = await CommonHelper.RetryAsync(async () =>
|
var all = await CommonHelper.RetryAsync(async () =>
|
||||||
{
|
{
|
||||||
var internalAll = new List<long>();
|
var internalAll = new List<long>();
|
||||||
@@ -244,7 +243,7 @@ public class AssignmentService : IAssignmentService
|
|||||||
var effect = await _dbContext.Updateable<DeviceTaskEntity>()
|
var effect = await _dbContext.Updateable<DeviceTaskEntity>()
|
||||||
.SetColumns(x => x.Status == DeviceTaskStatusEnumType.Process)
|
.SetColumns(x => x.Status == DeviceTaskStatusEnumType.Process)
|
||||||
.SetColumns(x => x.ModifiedTime == DateTime.Now)
|
.SetColumns(x => x.ModifiedTime == DateTime.Now)
|
||||||
.Where(x => internalAll.Contains(x.Id) && (x.Status == DeviceTaskStatusEnumType.Wait || x.Status == DeviceTaskStatusEnumType.Process))
|
.Where(x => internalAll.Contains(x.Id))
|
||||||
.ExecuteCommandAsync();
|
.ExecuteCommandAsync();
|
||||||
|
|
||||||
if (effect != internalAll.Count)
|
if (effect != internalAll.Count)
|
||||||
@@ -254,7 +253,7 @@ public class AssignmentService : IAssignmentService
|
|||||||
|
|
||||||
return internalAll;
|
return internalAll;
|
||||||
|
|
||||||
}, 5);
|
}, 3);
|
||||||
|
|
||||||
if (!all.Any())
|
if (!all.Any())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user