예제 #1
0
        private bool IsOutOfDate(string cacheKey, long ticksToCompare, ITimeStore timeStore)
        {
            var cachedTicks = timeStore.GetValueFromStore(cacheKey);

            if (cachedTicks == null)
            {
                throw new ApplicationException(
                          $"You must seed the database with a cache value for the key {cacheKey}.");
            }

            return(ticksToCompare < cachedTicks);
        }
예제 #2
0
 public void AddOrUpdate(ITimeStore timeStore)
 {
     timeStore.AddUpdateValue(AuthChangesConsts.FeatureCacheKey, DateTime.UtcNow.Ticks);
 }
예제 #3
0
 public void AddOrUpdate(ITimeStore timeStore)
 {
     CacheValueSet = true;
 }
예제 #4
0
        /// <summary>
        /// This returns true if ticksToCompareString is null, or if its value is lower than the value in the TimeStore
        /// </summary>
        /// <param name="cacheKey"></param>
        /// <param name="ticksToCompareString"></param>
        /// <param name="timeStore"></param>
        /// <returns></returns>
        public bool IsOutOfDateOrMissing(string cacheKey, string ticksToCompareString, ITimeStore timeStore)
        {
            if (ticksToCompareString == null)
            {
                //if there is no time claim then you do need to reset the claims
                return(true);
            }

            var ticksToCompare = long.Parse(ticksToCompareString);

            return(IsOutOfDate(cacheKey, ticksToCompare, timeStore));
        }
예제 #5
0
 public bool IsOutOfDateOrMissing(string cacheKey, string ticksToCompareString, ITimeStore timeStore)
 {
     throw new System.NotImplementedException();
 }