Esempio n. 1
0
        public SyncProfiles(Config appConfig, ILogger logger, IAppSettings appSettings, Profiles profiles, CachedProfiles cachedProfiles, ApiProfiles apiProfiles, SyncProfile syncProfile)
        {
            _appConfig      = appConfig;
            _logger         = logger;
            _appSettings    = appSettings;
            _profiles       = profiles;
            _cachedProfiles = cachedProfiles;
            _apiProfiles    = apiProfiles;
            _syncProfile    = syncProfile;

            _syncAction            = new CoalescingAction(SyncAction);
            _syncAction.Completed += OnSyncCompleted;

            _timer = new System.Timers.Timer
            {
                Interval  = _appConfig.ProfileSyncTimerPeriod.RandomizedWithDeviation(0.2).TotalMilliseconds,
                AutoReset = true
            };
            _timer.Elapsed += (s, e) => OnTimerElapsed();
        }
Esempio n. 2
0
 public SyncProfile(Config appConfig, ILogger logger, CachedProfiles cachedProfiles, ApiProfiles apiProfiles) :
     this(appConfig, logger, cachedProfiles, new NullSafeProfileStorage(apiProfiles))
 {
 }