Esempio n. 1
0
        public void Start()
        {
            var config = BackupConfigurationSection.GetSection();

            BackupWorker.Start(config);
            host = new ServiceHost(typeof(BackupService));
            host.Open();

            if (config.Cleaner.ElementInformation.IsPresent)
            {
                cleanerService = new BackupCleanerService {
                    Period = config.Cleaner.Period
                };
                cleanerService.Start();
            }
            if (config.Scheduler.ElementInformation.IsPresent)
            {
                schedulerService = new BackupSchedulerService {
                    Period = config.Scheduler.Period
                };
                schedulerService.Start();
            }
            deleterTempService = new BackupCleanerTempFileService();
            deleterTempService.Start();
        }
Esempio n. 2
0
        public Task StartAsync(CancellationToken cancellationToken)
        {
            NotifyConfiguration.Configure();

            var settings = Configuration.GetSetting <BackupSettings>("backup");

            BackupWorker.Start(settings);
            BackupListener.Start();

            CleanerService.Period = settings.Cleaner.Period;
            CleanerService.Start();

            SchedulerService.Period = settings.Scheduler.Period;
            SchedulerService.Start();

            return(Task.CompletedTask);
        }