public TradesMigrationService(
            ICandlesHistoryRepository candlesHistoryRepository,
            TradesMigrationHealthService tradesMigrationHealthService,
            ILogFactory logFactory,
            IHealthNotifier healthNotifier,
            string sqlConnString,
            int sqlQueryBatchSize,
            TimeSpan sqlTimeout,
            int candlesPersistenceQueueMaxSize
            )
        {
            _candlesHistoryRepository     = candlesHistoryRepository ?? throw new ArgumentNullException(nameof(candlesHistoryRepository));
            _tradesMigrationHealthService = tradesMigrationHealthService ?? throw new ArgumentNullException(nameof(tradesMigrationHealthService));
            _logFactory     = logFactory;
            _healthNotifier = healthNotifier;

            if (logFactory == null)
            {
                throw new ArgumentNullException(nameof(logFactory));
            }

            _log = logFactory.CreateLog(this);

            _sqlConnString     = sqlConnString;
            _sqlQueryBatchSize = sqlQueryBatchSize;
            _sqlTimeout        = sqlTimeout;
            _candlesPersistenceQueueMaxSize = Convert.ToInt32(candlesPersistenceQueueMaxSize * 1.1);  // Safe reserve
        }
Beispiel #2
0
        public TradesMigrationManager(
            IAssetPairsManager assetPairsManager,
            ITradesMigrationService tradesMigrationServicey,
            TradesMigrationHealthService tradesMigrationHealthService,
            ILog log,
            int sqlQueryBatchSize,
            bool migrationEnabled
            )
        {
            _assetPairsManager            = assetPairsManager ?? throw new ArgumentNullException(nameof(assetPairsManager));
            _tradesMigrationService       = tradesMigrationServicey ?? throw new ArgumentNullException(nameof(tradesMigrationServicey));
            _tradesMigrationHealthService = tradesMigrationHealthService ?? throw new ArgumentNullException(nameof(tradesMigrationHealthService));
            _log = log ?? throw new ArgumentNullException(nameof(log));

            _sqlQueryBatchSize = sqlQueryBatchSize;

            MigrationEnabled = migrationEnabled;
        }
Beispiel #3
0
        public TradesMigrationService(
            ICandlesHistoryRepository candlesHistoryRepository,
            TradesMigrationHealthService tradesMigrationHealthService,
            ILog log,
            string sqlConnString,
            int sqlQueryBatchSize,
            TimeSpan sqlTimeout,
            int candlesPersistenceQueueMaxSize
            )
        {
            _candlesHistoryRepository     = candlesHistoryRepository ?? throw new ArgumentNullException(nameof(candlesHistoryRepository));
            _tradesMigrationHealthService = tradesMigrationHealthService ?? throw new ArgumentNullException(nameof(tradesMigrationHealthService));
            _log = log ?? throw new ArgumentNullException(nameof(log));

            _sqlConnString     = sqlConnString;
            _sqlQueryBatchSize = sqlQueryBatchSize;
            _sqlTimeout        = sqlTimeout;
            _candlesPersistenceQueueMaxSize = Convert.ToInt32(candlesPersistenceQueueMaxSize * 1.1);  // Safe reserve
        }
Beispiel #4
0
        public TradesMigrationManager(
            IAssetPairsManager assetPairsManager,
            ITradesMigrationService tradesMigrationServicey,
            TradesMigrationHealthService tradesMigrationHealthService,
            ILogFactory logFactory,
            int sqlQueryBatchSize,
            bool migrationEnabled
            )
        {
            _assetPairsManager            = assetPairsManager ?? throw new ArgumentNullException(nameof(assetPairsManager));
            _tradesMigrationService       = tradesMigrationServicey ?? throw new ArgumentNullException(nameof(tradesMigrationServicey));
            _tradesMigrationHealthService = tradesMigrationHealthService ?? throw new ArgumentNullException(nameof(tradesMigrationHealthService));

            if (logFactory == null)
            {
                throw new ArgumentNullException(nameof(logFactory));
            }

            _log = logFactory.CreateLog(this);

            _sqlQueryBatchSize = sqlQueryBatchSize;

            MigrationEnabled = migrationEnabled;
        }