public void StartScan() { _stopRequest = false; int scanInterval = Int32.Parse(System.Configuration.ConfigurationManager.AppSettings["ScanInterval"]); _vaultProcessor = new VaultProcessor(); try { while (!_stopRequest) { //TODO:watch on vaulted_docs and handle that to porocess. Log.Info("Scanning for un posted vaults.."); List<VaultUploader.Data.Models.VaultedDocs> unVaultedDocs = FindUnpostedVaults(); if (unVaultedDocs.Count > 0) { Log.Info(String.Format("Found {0} un posted vault docs", unVaultedDocs.Count)); _vaultProcessor.Process(unVaultedDocs); } Thread.Sleep(scanInterval); } } catch (Exception ex) { //TODO:Do mail kind of stuff on critical erros //and some fixed iterations.. Log.Error(ex.Message + System.Environment.NewLine + ex.StackTrace); } }
public void StartScan() { _stopRequest = false; int scanInterval = Int32.Parse(System.Configuration.ConfigurationManager.AppSettings["ScanInterval"]); _vaultProcessor = new VaultProcessor(); try { while (!_stopRequest) { //TODO:watch on vaulted_docs and handle that to porocess. Log.Info("Scanning for un posted vaults.."); List <VaultUploader.Data.Models.VaultedDocs> unVaultedDocs = FindUnpostedVaults(); if (unVaultedDocs.Count > 0) { Log.Info(String.Format("Found {0} un posted vault docs", unVaultedDocs.Count)); _vaultProcessor.Process(unVaultedDocs); } Thread.Sleep(scanInterval); } } catch (Exception ex) { //TODO:Do mail kind of stuff on critical erros //and some fixed iterations.. Log.Error(ex.Message + System.Environment.NewLine + ex.StackTrace); } }