Skip to content

Commit

Permalink
Merge pull request #860 from gbirchmeier/anotherLog
Browse files Browse the repository at this point in the history
one more NonSessionLog call
  • Loading branch information
gbirchmeier authored Jun 27, 2024
2 parents e1f0452 + 5fb2582 commit d16832b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions QuickFIXn/Transport/SocketInitiator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,16 +178,15 @@ protected override void OnStart()
double reconnectIntervalAsMilliseconds = 1000 * _reconnectInterval;
DateTime nowDt = DateTime.UtcNow;

if ((nowDt.Subtract(_lastConnectTimeDt).TotalMilliseconds) >= reconnectIntervalAsMilliseconds)
if (nowDt.Subtract(_lastConnectTimeDt).TotalMilliseconds >= reconnectIntervalAsMilliseconds)
{
Connect();
_lastConnectTimeDt = nowDt;
}
}
catch (Exception e)
{
// TODO: temporary hack, need to implement a session-independent log
File.AppendAllText("SocketInitiator-OnStart-Failure.log", $"{DateTime.Now:G}: {e}{Environment.NewLine}");
_nonSessionLog.OnEvent($"Failed to start: {e}");
}

Thread.Sleep(1 * 1000);
Expand Down

0 comments on commit d16832b

Please sign in to comment.