Fix worker and signal

This commit is contained in:
2025-07-21 23:30:54 +07:00
parent 83ed78a1fa
commit 27c1e9d1ba
13 changed files with 132 additions and 60 deletions

View File

@@ -31,9 +31,7 @@ public class NotifyBundleBacktestWorker : BaseWorker<NotifyBundleBacktestWorker>
try
{
// Fetch all running bundle requests
var runningBundles = _backtester.GetPendingBundleBacktestRequests()
.Where(b => b.Status == BundleBacktestRequestStatus.Running)
.ToList();
var runningBundles = _backtester.GetBundleBacktestRequestsByStatus(BundleBacktestRequestStatus.Running);
foreach (var bundle in runningBundles)
{
@@ -53,7 +51,8 @@ public class NotifyBundleBacktestWorker : BaseWorker<NotifyBundleBacktestWorker>
var lightResponse = backtest as LightBacktest;
if (lightResponse != null)
{
await _hubContext.Clients.Group($"bundle-{requestId}").SendAsync("BundleBacktestUpdate", lightResponse, stoppingToken);
await _hubContext.Clients.Group($"bundle-{requestId}")
.SendAsync("BundleBacktestUpdate", lightResponse, stoppingToken);
_sentBacktestIds[requestId].Add(backtest.Id);
}
}
@@ -70,4 +69,4 @@ public class NotifyBundleBacktestWorker : BaseWorker<NotifyBundleBacktestWorker>
_logger.LogError(ex, "Error in NotifyBundleBacktestWorker");
}
}
}
}