From 44442e003354b540d86dddee80bad24262c7a491 Mon Sep 17 00:00:00 2001 From: Denis Tereshkin Date: Tue, 23 Apr 2024 21:38:22 +0700 Subject: [PATCH] Make starting sqnum equal to current posix time --- src/Main.hs | 4 +++- src/TXMLConnector/Internal.hs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Main.hs b/src/Main.hs index 658dc5a..6d8d7ab 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -29,6 +29,7 @@ import Control.Exception (bracket) import Control.Monad (forever, void) import Control.Monad.IO.Class (MonadIO) import qualified Data.Text as T +import Data.Time.Clock.POSIX (getPOSIXTime) import Data.Version (showVersion) import Debug.EventCounters (emitEvent, initEventCounters) @@ -108,12 +109,13 @@ main = do tickTable <- newTickTable paper <- mkPaperBroker tickTable tisH qssCh2 (fromDouble 100000.0) ["demo"] (commissions cfg) logger txml <- Connector.start logger tickTable cfg qssChannel tisH + startTimestamp <- floor <$> getPOSIXTime bracket (startBrokerServer [Connector.makeBrokerBackend txml (account cfg), paper] ctx (brokerEndpoint cfg) (brokerNotificationsEndpoint cfg) - (NotificationSqnum 1) + (NotificationSqnum startTimestamp) [tsDashboard, tsGotify] defaultServerSecurityParams logger) (\x -> do diff --git a/src/TXMLConnector/Internal.hs b/src/TXMLConnector/Internal.hs index e1cd9b3..3b61d43 100644 --- a/src/TXMLConnector/Internal.hs +++ b/src/TXMLConnector/Internal.hs @@ -559,7 +559,7 @@ handleGetInfo = do tisH <- asks tisHandle let tickerInfos = securityToTickerInfo <$> securities log Info "TXMLConnector.WorkThread" $ "Incoming securities: " <> (T.pack . show . length) securities - --forM_ tickerInfos (log Debug "TXMLConnector.WorkThread" . T.pack . show . tiTicker) + forM_ tickerInfos (log Debug "TXMLConnector.WorkThread" . T.pack . show . tiTicker) forM_ tickerInfos (liftIO . putTickerInfo tisH) pure Nothing TransaqResponseSecInfo secInfo -> do