Refactor services to use DI for IHaContext and TimeProvider
This commit is contained in:
@@ -23,7 +23,6 @@ public class CheapestIntervalsFinder(ILogger<CheapestIntervalsFinder> logger) :
|
||||
}
|
||||
|
||||
var eligible = prices.Prices
|
||||
.AsParallel()
|
||||
.Where(p => p is { Start: not null, End: not null, Price: not null })
|
||||
.Where(p => p.End!.Value <= deadline)
|
||||
.Where(p => p.Price!.Value <= priceCap)
|
||||
@@ -48,6 +47,6 @@ public class CheapestIntervalsFinder(ILogger<CheapestIntervalsFinder> logger) :
|
||||
|
||||
public bool IsCurrentIntervalCheap(IReadOnlyList<CheapestIntervalResult> cheapestIntervals, DateTime utcNow)
|
||||
{
|
||||
return cheapestIntervals.AsParallel().Any(interval => utcNow >= interval.Start && utcNow < interval.End);
|
||||
return cheapestIntervals.Any(interval => utcNow >= interval.Start && utcNow < interval.End);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user