private async Task RunAndRescheduleNoThrow()
        {
            try
            {
                var logger = new SynchronizationLogger(_profileId, _profileName);

                using (AutomaticStopwatch.StartInfo(s_logger, string.Format("Running synchronization profile '{0}'", _profileName)))
                {
                    await _synchronizer.SynchronizeNoThrow(logger);
                }

                GC.Collect();
                GC.WaitForPendingFinalizers();
                var synchronizationReport = logger.GetReport();
                _reportSink.PostReport(synchronizationReport);
            }
            catch (Exception x)
            {
                s_logger.Error(null, x);
            }
            finally
            {
                _lastRun = DateTime.UtcNow;
            }
        }
        private async Task RunIfResponsibleNoThrow(IEnumerable <string> itemsToSync)
        {
            try
            {
                var logger = new SynchronizationLogger(_profileId, _profileName);

                using (AutomaticStopwatch.StartInfo(s_logger, string.Format("Running synchronization profile '{0}'", _profileName)))
                {
                    await _synchronizer.SnychronizePartialNoThrow(itemsToSync, logger);
                }

                GC.Collect();
                GC.WaitForPendingFinalizers();
                var synchronizationReport = logger.GetReport();
                _synchronizationReportRepository.AddReport(synchronizationReport);
            }
            catch (Exception x)
            {
                ExceptionHandler.Instance.HandleException(x, s_logger);
            }
        }
コード例 #3
0
        private async Task RunPartialNoThrow(IIdWithHints <string, DateTime>[] itemsToSync)
        {
            try
            {
                var logger = new SynchronizationLogger(_profileId, _profileName);

                using (AutomaticStopwatch.StartInfo(s_logger, string.Format("Partial sync: Running synchronization profile '{0}'", _profileName)))
                {
                    await _synchronizer.SnychronizePartialNoThrow(itemsToSync, logger);
                }

                GC.Collect();
                GC.WaitForPendingFinalizers();
                var synchronizationReport = logger.GetReport();
                _reportSink.PostReport(synchronizationReport);
            }
            catch (Exception x)
            {
                s_logger.Error(null, x);
            }
        }