Fix: Implement FixPlan part A9, A10, B
This commit is contained in:
@@ -44,6 +44,7 @@ public class TradeRetentionWorker : BackgroundService
|
||||
{
|
||||
await RunOptimizationAsync(stoppingToken);
|
||||
}
|
||||
catch (OperationCanceledException) { break; }
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error occurred executing TradeRetentionWorker cycle.");
|
||||
@@ -61,6 +62,13 @@ public class TradeRetentionWorker : BackgroundService
|
||||
var db = scope.ServiceProvider.GetRequiredService<AppDbContext>();
|
||||
|
||||
// Load configuration values
|
||||
bool isEnabled = _config.GetValue("RetentionSettings:Enabled", true);
|
||||
if (!isEnabled)
|
||||
{
|
||||
_logger.LogInformation("🧹 TradeRetentionWorker: Retention is disabled in configuration. Skipping optimization.");
|
||||
return;
|
||||
}
|
||||
|
||||
var retentionDays = _config.GetValue("RetentionSettings:RetentionDays", 90);
|
||||
var compactionDays = _config.GetValue("RetentionSettings:CompactionDays", 14);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user