Remaining time estimate

This commit is contained in:
2017-02-03 22:26:00 -05:00
parent 77a35e87d3
commit b4440ecd95
27 changed files with 3579 additions and 550 deletions
+13 -2
View File
@@ -57,8 +57,19 @@ namespace LeafWeb.Core.DAL
public IQueryable<LeafInput> GetLeafInputsOrdered()
{
return _db.LeafInputs
.OrderByDescending(li => li.CurrentStatus == LeafInputStatusType.Pending)
.ThenByDescending(li => li.PendingPriority)
// first by in-progress items
.OrderByDescending(li =>
li.CurrentStatus == LeafInputStatusType.Running ||
li.CurrentStatus == LeafInputStatusType.Starting ||
li.CurrentStatus == LeafInputStatusType.Finishing ||
li.CurrentStatus == LeafInputStatusType.Cancelling ||
li.CurrentStatus == LeafInputStatusType.CancelPending)
// then by pending, by priority
.ThenByDescending(li =>
li.CurrentStatus == LeafInputStatusType.Pending
? (int)li.PendingPriority
: int.MinValue)
// then the rest by the order they're added in
.ThenByDescending(li => li.Id);
}