Try fixing orleans server runtime
This commit is contained in:
@@ -409,7 +409,7 @@ public class LiveTradingBotGrain : Grain<TradingBotGrainState>, ITradingBotGrain
|
||||
{
|
||||
try
|
||||
{
|
||||
if (_tradingBot == null || State.Status != BotStatus.Up)
|
||||
if (_tradingBot == null || State.Status != BotStatus.Up || _isDisposed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -422,6 +422,12 @@ public class LiveTradingBotGrain : Grain<TradingBotGrainState>, ITradingBotGrain
|
||||
|
||||
await SaveBackupToState();
|
||||
}
|
||||
catch (ObjectDisposedException)
|
||||
{
|
||||
// Gracefully handle disposed service provider during shutdown
|
||||
_logger.LogInformation("Service provider disposed during shutdown for LiveTradingBotGrain {GrainId}", this.GetPrimaryKey());
|
||||
return;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error during bot execution cycle for LiveTradingBotGrain {GrainId}", this.GetPrimaryKey());
|
||||
|
||||
Reference in New Issue
Block a user