Refactor services to use DI for IHaContext and TimeProvider

This commit is contained in:
2026-07-03 12:15:44 +03:00
parent 7f280bea7b
commit 2706a6b188
23 changed files with 146 additions and 374 deletions
+1 -2
View File
@@ -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);
}
}