Skip to content

Commit

Permalink
Reduce realtime shutdown timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin-Molinero committed Sep 20, 2024
1 parent 7c42ea7 commit 4d37096
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Engine/AlgorithmManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ public void SetStatus(AlgorithmStatus state)
_algorithm.SetStatus(state);
}

if (!_cancellationTokenSource.IsCancellationRequested && !_cancelRequested)
if (_cancellationTokenSource != null && !_cancellationTokenSource.IsCancellationRequested && !_cancelRequested)
{
if (state == AlgorithmStatus.Deleted)
{
Expand Down
2 changes: 1 addition & 1 deletion Engine/RealTime/LiveTradingRealTimeHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public override void ScanPastEvents(DateTime time)
/// </summary>
public override void Exit()
{
_realTimeThread.StopSafely(TimeSpan.FromMinutes(5), _cancellationTokenSource);
_realTimeThread.StopSafely(TimeSpan.FromMinutes(1), _cancellationTokenSource);
_cancellationTokenSource.DisposeSafely();
base.Exit();
}
Expand Down

0 comments on commit 4d37096

Please sign in to comment.