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);
        }
Esempio n. 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);
            }
        }
Esempio n. 3
0
 public DateTimeOffset?GetLastOpened() => keyValueStorage.GetDateTimeOffset(lastAccessDateKey);
Esempio n. 4
0
 public DateTimeOffset?RatingViewOutcomeTime()
 => keyValueStorage.GetDateTimeOffset(ratingViewOutcomeTimeKey);