private bool shouldScheduleSyncJob(IKeyValueStorage keyValueStorage)
        {
            var now = DateTimeOffset.Now;
            var hasPendingJobScheduled = keyValueStorage.GetBool(HasPendingSyncJobServiceScheduledKey);
            var lastSyncJobScheduledAt = keyValueStorage.GetDateTimeOffset(LastSyncJobScheduledAtKey).GetValueOrDefault();

            return(!hasPendingJobScheduled || now.Subtract(lastSyncJobScheduledAt).TotalHours > jobScheduleExpirationInHours);
        }
Exemple #2
0
        public bool NeedsToUpdateStoredRemoteConfigData()
        {
            lock (updateLock)
            {
                var lastFetchAt = keyValueStorage.GetDateTimeOffset(LastFetchAtKey);
                if (!lastFetchAt.HasValue)
                {
                    return(true);
                }

                var now = timeService.CurrentDateTime;
                return(now.Subtract(lastFetchAt.Value) > RemoteConfigExpiration);
            }
        }
Exemple #3
0
 public DateTimeOffset?GetLastOpened() => keyValueStorage.GetDateTimeOffset(lastAccessDateKey);
Exemple #4
0
 public DateTimeOffset?RatingViewOutcomeTime()
 => keyValueStorage.GetDateTimeOffset(ratingViewOutcomeTimeKey);