Bundle from worker to grain

This commit is contained in:
2025-09-15 12:56:59 +07:00
parent 77e6ce0789
commit 63bc7bbe59
19 changed files with 2112 additions and 79 deletions

View File

@@ -277,7 +277,7 @@ public class BundleBacktestWorker : BaseWorker<BundleBacktestWorker>
bundleRequest.User, // No user context in worker
true,
runBacktestRequest.WithCandles,
bundleRequest.RequestId // Use bundleRequestId as requestId for traceability
bundleRequest.RequestId.ToString() // Use bundleRequestId as requestId for traceability
);
_logger.LogInformation("Processed backtest for bundle request {RequestId}", bundleRequest.RequestId);

View File

@@ -13,7 +13,7 @@ public class NotifyBundleBacktestWorker : BaseWorker<NotifyBundleBacktestWorker>
{
private readonly IServiceProvider _serviceProvider;
private readonly IHubContext<BacktestHub> _hubContext;
private readonly ConcurrentDictionary<string, HashSet<string>> _sentBacktestIds = new();
private readonly ConcurrentDictionary<Guid, HashSet<string>> _sentBacktestIds = new();
public NotifyBundleBacktestWorker(
IServiceProvider serviceProvider,
@@ -39,7 +39,6 @@ public class NotifyBundleBacktestWorker : BaseWorker<NotifyBundleBacktestWorker>
foreach (var bundle in runningBundles)
{
var requestId = bundle.RequestId;
if (string.IsNullOrEmpty(requestId)) continue;
// Fetch all backtests for this bundle
var (backtests, _) = backtester.GetBacktestsByRequestIdPaginated(requestId, 1, 100);