Example #1
0
        private void Run()
        {
            var config = new AppJsonConfiguration();
            var secret = new PrivateJsonConfiguration();

            Logger.Info($"Harmony version {config.AppVersion}");
            _timer.Enabled = false;
            try
            {
                ProcessVaults.Run(secret.MFiles.ServerName, secret.MFiles.UserName, secret.MFiles.Password,
                                  config.Vaults.Select(v => v.Name).ToArray(), config.View, config.StartDate,
                                  config.Vaults.Where(v => v.Crm != null)
                                  .ToDictionary(vault => vault.Name,
                                                vault => from p in vault.Crm select new PropertyListType(vault.Name, p.Type, p.Property)),
                                  new MainProcessor(secret.ConnectionString, config.Vaults.ToDictionary(cfg => cfg.Name, cfg => cfg),
                                                    config.ThumbnailsUrlPattern, config.BrsTermsUrlPattern, config.LeoTermsUrlPattern,
                                                    new CountriesClient(config.TreatiesServiceUrl),
                                                    new ConferencesClient(config.ConferencesServiceUrl),
                                                    config.DeleteNotProcessed)
                                  );
            }
            catch (Exception ex)
            {
                Logger.Error(ex, "Service exception:  " + ex);
            }
            _timer.Interval = config.ServiceInterval * 60 * 1000;
            _timer.Enabled  = true;
            Logger.Info($"Next harmonization in {config.ServiceInterval} minutes");
        }
Example #2
0
        private static void Run()
        {
            var config = new AppJsonConfiguration();
            var secret = new PrivateJsonConfiguration();

            Logger.Info($"Harmony version {config.AppVersion}");
            ProcessVaults.Run(secret.MFiles.ServerName, secret.MFiles.UserName, secret.MFiles.Password,
                              config.Vaults.Select(v => v.Name).ToArray(), config.View, config.StartDate,
                              config.Vaults.Where(v => v.Crm != null).ToDictionary(vault => vault.Name, vault => from p in vault.Crm select new PropertyListType(vault.Name, p.Type, p.Property)),
                              new MainProcessor(secret.ConnectionString, config.Vaults.ToDictionary(cfg => cfg.Name, cfg => cfg),
                                                config.ThumbnailsUrlPattern, config.BrsTermsUrlPattern, config.LeoTermsUrlPattern, new CountriesClient(config.TreatiesServiceUrl), new ConferencesClient(config.ConferencesServiceUrl),
                                                config.DeleteNotProcessed)
                              );
        }