Ejemplo n.º 1
0
        private void ProcessTask()
        {
            if (Monitor.TryEnter(syncRoot))
            {
                logger.LogInformation("Process task started");

                if (!connector.IsConnected)
                {
                    connector.CreateRabbitConnection();
                }

                CheckRabbitMQ();

                //for (int i = 0; i < 3; ++i) DoWork();

                logger.LogInformation("Process task finished");
                Monitor.Exit(syncRoot);
            }
            else
            {
                logger.LogInformation("Processing is currently in progress. Skippeed");
            }
        }