Exemplo n.º 1
0
        public FolderMonitor(ServiceCheckClient client, CancellationTokenSource tokenSource, CancellationToken token)
        {
            _monitorFolder  = ConfigurationManager.AppSettings["monitorFolder"];
            _compliteFolder = ConfigurationManager.AppSettings["compliteFolder"];
            _garbageFolder  = ConfigurationManager.AppSettings["garbageFolder"];

            _tokenSource = tokenSource;
            _token       = token;
            _client      = client;

            Logger.Log.Info("FolderMonitor constructor Ok");
        }
Exemplo n.º 2
0
 protected override void OnStart(string[] args)
 {
     try
     {
         _client = new ServiceCheckClient();
         FolderMonitor folder = new FolderMonitor(_client, _tokenSource, _token);
         _folderMonitorTask = folder.StartWatch();
         Logger.Log.Info("ServiceMonitor OnStart Ok");
     }
     catch (Exception e)
     {
         Logger.Log.Error("ServiceMonitor OnStart Fail", e);
     }
 }