Update running time exec

This commit is contained in:
2025-09-14 23:02:42 +07:00
parent c60bc4123a
commit 37d57a1bb8
8 changed files with 47 additions and 59 deletions

View File

@@ -123,7 +123,7 @@ public class TradingBotBase : ITradingBot
{
var grainKey = CandleHelpers.GetCandleStoreGrainKey(Account.Exchange, Config.Ticker, Config.Timeframe);
var grain = grainFactory.GetGrain<ICandleStoreGrain>(grainKey);
try
{
// Add a small delay to ensure grain is fully activated
@@ -133,7 +133,7 @@ public class TradingBotBase : ITradingBot
catch (InvalidOperationException ex) when (ex.Message.Contains("invalid activation"))
{
Logger.LogWarning("Grain activation failed for {GrainKey}, retrying in 1 second...", grainKey);
// Wait a bit longer and retry once
await Task.Delay(1000);
try
@@ -215,7 +215,7 @@ public class TradingBotBase : ITradingBot
await ServiceScopeHelpers.WithScopedService<IGrainFactory>(_scopeFactory, async grainFactory =>
{
var scenarioRunnerGrain = grainFactory.GetGrain<IScenarioRunnerGrain>(Guid.NewGuid());
var signal = await scenarioRunnerGrain.GetSignals(Config, Signals, PreloadSince, LastCandle);
var signal = await scenarioRunnerGrain.GetSignals(Config, Signals, Account.Exchange, LastCandle);
if (signal == null) return;
await AddSignal(signal);
});