Remaining time estimate
This commit is contained in:
+13
-2
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user