public Collector(MailBoxManager manager, MailQueueSettings settings, List <MessageHandlerBase> message_handlers)
        {
            _log = LoggerFactory.GetLogger(LoggerFactory.LoggerType.Nlog, "Collector");

            Environment.SetEnvironmentVariable("MONO_TLS_SESSION_CACHE_TIMEOUT", "0");

            _manager    = manager;
            _settings   = settings;
            _itemManger = new MailItemManager(_manager, message_handlers);
            _queue      = new MailWorkerQueue(settings.ConcurrentThreadCount, settings.CheckInterval, this);

            _log.Info("MailWorkerQueue: ConcurrentThreadCount = {0} and CheckInterval = {1}",
                      settings.ConcurrentThreadCount, settings.CheckInterval);

            var config_builder = new TasksConfig.Builder();

            if (settings.WorkOnUsersOnly != null && settings.WorkOnUsersOnly.Any())
            {
                var i     = 0;
                var users = string.Empty;
                settings.WorkOnUsersOnly.ForEach(user => users += string.Format("\r\n\t\t\t\t{0}. \"{1}\"", ++i, user));

                _log.Info("Aggreagtor will get tasks for this users only:" + users);
            }

            config_builder.SetUsersToWorkOn(settings.WorkOnUsersOnly);
            config_builder.SetOnlyTeamlabTasks(settings.OnlyTeamlabTasks);
            config_builder.SetActiveInterval(settings.ActivityTimeout);

            _tasksConfig = config_builder.Build();
        }
Example #2
0
        public Collector(MailBoxManager manager, MailQueueSettings settings)
        {
            _log        = LogManager.GetLogger("Collector");
            _manager    = manager;
            _settings   = settings;
            _itemManger = new MailItemManager(_manager);
            _queue      = new MailWorkerQueue(settings.ConcurrentThreadCount, settings.CheckInterval, this);

            _log.Info("MailWorkerQueue: ConcurrentThreadCount = {0} and CheckInterval = {1}",
                      settings.ConcurrentThreadCount, settings.CheckInterval);
        }
Example #3
0
        public Collector(MailBoxManager manager, MailQueueSettings settings, List <MessageHandlerBase> message_handlers)
        {
            _log        = LoggerFactory.GetLogger(LoggerFactory.LoggerType.Nlog, "Collector");
            _manager    = manager;
            _settings   = settings;
            _itemManger = new MailItemManager(_manager, message_handlers);
            _queue      = new MailWorkerQueue(settings.ConcurrentThreadCount, settings.CheckInterval, this);

            _log.Info("MailWorkerQueue: ConcurrentThreadCount = {0} and CheckInterval = {1}",
                      settings.ConcurrentThreadCount, settings.CheckInterval);

            if (settings.WorkOnUsersOnly != null && settings.WorkOnUsersOnly.Any())
            {
                var i     = 0;
                var users = string.Empty;
                settings.WorkOnUsersOnly.ForEach(user => users += string.Format("\r\n\t\t\t\t{0}. \"{1}\"", ++i, user));

                _log.Info("Aggreagtor will get tasks for this users only:" + users);
            }
        }