示例#1
0
        /// <summary>
        /// Will get the data from application insights and send them to the appropriate place
        /// </summary>
        /// <param name="state"></param>
        private async Task ProcessData(object state)
        {
            lock (_runningLock)
            {
                if (isRunning)
                {
                    return;
                }
                isRunning = true;
            }

            var list = await _applicationInsights.GetQueue();

            foreach (var item in list)
            {
                foreach (var provider in _insightProviders.Values)
                {
                    if (provider != null)
                    {
                        await provider.Send(item);
                    }
                }
            }

            await _applicationInsights.Clear(list);

            isRunning = false;
        }