Add cancellation token support across NordPool services and update constants for reuse
- Introduced `CancellationToken` to service methods for improved task cancellation handling. - Centralized reusable constants (`MinutesPerInterval`, `WaterReadyPowerThresholdWatts`) in `NordPoolConsts`. - Refactored `ConfigureAwait` usage and improved logging within `NordPoolEntityService`. - Adjusted tests to accommodate cancellation token changes.
This commit is contained in:
@@ -1,6 +1,16 @@
|
||||
namespace NordPool.Models;
|
||||
namespace NordPool.Models;
|
||||
|
||||
public static class NordPoolConsts
|
||||
{
|
||||
public static readonly string ConfigEntry = "01K9HYQE4Y0E7KC36JZV11MEXH";
|
||||
|
||||
/// <summary>
|
||||
/// NordPool electricity market uses 15-minute trading intervals.
|
||||
/// </summary>
|
||||
public const int MinutesPerInterval = 15;
|
||||
|
||||
/// <summary>
|
||||
/// Power threshold in watts below which the boiler is considered to have finished heating (water ready).
|
||||
/// </summary>
|
||||
public const double WaterReadyPowerThresholdWatts = 5.0;
|
||||
}
|
||||
Reference in New Issue
Block a user