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