public void Remove(T quote)
        {
            if (quote == null)
            {
                return;
            }

            // Purposely not adding try/catch semantics here - if the first call fails, we do not want to remove from the index. If the first call succeeds but the index
            // removal fails, we dont bother trying to re-add the primary back, as the index is just a pointer to the primary...
            _quoteStorageService.Remove(quote);
            _quoteIndexService.Remove(quote);
        }
Esempio n. 2
0
        private void DoCleanup(IList <T> quotes)
        {
            try
            {
                Console.WriteLine($"  Background index cleanup starting for [{quotes.Count}] quotes");

                foreach (var quote in quotes)
                {
                    _indexService.Remove(quote);
                }
            }
            finally
            {
                _inCleanup = false;

                Console.WriteLine($"  Background index cleanup finished for [{quotes.Count}] quotes");
            }
        }