Exemplo n.º 1
0
        public Task WaitForIndexingAsync(AsyncManualResetEvent.FrozenAwaiter indexingBatchCompleted)
        {
            var remainingTime = _waitTimeout - _queryDuration.Elapsed;

            if (remainingTime <= TimeSpan.Zero)
            {
                TimeoutExceeded = true;
                return(Task.CompletedTask);
            }

            var waitForIndexingAsync = indexingBatchCompleted.WaitAsync(TimeSpan.FromSeconds(15));

            return(waitForIndexingAsync);
        }
Exemplo n.º 2
0
        public Task WaitForIndexingAsync(AsyncManualResetEvent.FrozenAwaiter indexingBatchCompleted)
        {
            _index.AssertNotDisposed();

            if (_isMaxTimeout)
            {
                return(indexingBatchCompleted.WaitAsync());
            }

            var remainingTime = _waitTimeout - _queryDuration.Elapsed;

            if (remainingTime <= TimeSpan.Zero)
            {
                TimeoutExceeded = true;
                return(Task.CompletedTask);
            }

            return(indexingBatchCompleted.WaitAsync(remainingTime));
        }