Example #1
0
        private void OnAccountLocked(object sender, AccountLockedEventArgs e)
        {
            if (e.Address != _consumerAddress)
            {
                return;
            }

            _consumerNotifier.SendConsumerAccountLockedAsync(e.Address);
            if (_logger.IsInfo)
            {
                _logger.Info($"Locked a consumer account: '{e.Address}', all of the existing data streams will be disabled.");
            }

            var sessions           = _sessionService.GetAllActive();
            var disableStreamTasks = from session in sessions
                                     from client in session.Clients
                                     select _dataStreamService.DisableDataStreamAsync(session.DepositId, client.Id);

            Task.WhenAll(disableStreamTasks).ContinueWith(t =>
            {
                if (t.IsFaulted && _logger.IsError)
                {
                    _logger.Error("Disabling the data stream has failed.", t.Exception);
                }
            });
        }
Example #2
0
        private void OnAccountLocked(object?sender, AccountLockedEventArgs e)
        {
            if (e.Address != _providerAddress)
            {
                return;
            }

            _accountLocked = true;
        }