private ExecutingQueryInfo AddToCurrentlyRunningQueryList(string index, IndexQuery query, CancellationTokenSource externalTokenSource) { var set = WorkContext.CurrentlyRunningQueries.GetOrAdd(index, x => new ConcurrentSet <ExecutingQueryInfo>()); var queryStartTime = DateTime.UtcNow; var queryId = WorkContext.GetNextQueryId(); var executingQueryInfo = new ExecutingQueryInfo(queryStartTime, query, queryId, externalTokenSource); set.Add(executingQueryInfo); return(executingQueryInfo); }