Пример #1
0
        public override void Start()
        {
            var accounts = _repository.GetAllAsync().GetAwaiter().GetResult()
                           .Select(MarginTradingAccount.Create).GroupBy(x => x.ClientId).ToDictionary(x => x.Key, x => x.ToArray());

            _accountsCacheService.InitAccountsCache(accounts);
            _console.WriteLine($"InitAccountsCache (clients count:{accounts.Count})");

            base.Start();
        }
Пример #2
0
        public override void Start()
        {
            _log.WriteInfo(nameof(Start), nameof(AccountManager), "Starting InitAccountsCache");

            var accounts = GetAccounts().GetAwaiter().GetResult();

            _accountsCacheService.InitAccountsCache(accounts);
            _log.WriteInfo(nameof(Start), nameof(AccountManager), $"Finished InitAccountsCache. Count: {accounts.Count}");

            base.Start();
        }
Пример #3
0
        public override void Start()
        {
            _console.WriteLine("Starting InitAccountsCache");

            var accounts = _accountsApi.List().GetAwaiter().GetResult()
                           .Select(Convert).ToDictionary(x => x.Id);

            //TODO: think about approach
            //ApplyMarginFreezing(accounts);

            _accountsCacheService.InitAccountsCache(accounts);
            _console.WriteLine($"Finished InitAccountsCache. Count: {accounts.Count}");

            base.Start();
        }