public StorageCleanerService()
        {
            CanStop = true;

            AutoLog = true;

            XmlConfigurator.Configure();

            _log = LoggerFactory.GetLogger(LoggerFactory.LoggerType.Log4Net, "MailCleaner");

            _resetEvent = new ManualResetEvent(false);

            _tsInterval = TimeSpan.FromMinutes(Convert.ToInt32(ConfigurationManager.AppSettings["cleaner.timer-wait-minutes"]));

            var config = MailGarbageEraserConfig.FromConfig();

            _log.Info("Service will clear mail storage every {0} minutes\r\n", _tsInterval.TotalMinutes);

            _eraser = new MailGarbageEraser(config, _log);
        }
Exemple #2
0
 public MailGarbageEngine(ILog log = null)
     : this(MailGarbageEraserConfig.FromConfig(), log)
 {
 }