Beispiel #1
0
        /// <summary>
        /// 获取已过期的hashKey
        /// 其中Item1为SortSet的Key,Item2为SortSet的Value,Item3为HashSet的Key,Item4为HashSet的HashKey
        /// </summary>
        /// <param name="count"></param>
        /// <returns></returns>
        public List <ValueTuple <string, string, string, string> > SortedSetRangeByRankAndOverTime(long count = 1000)
        {
            var keyList = QuickHelperBase
                          .ZRevRangeByScore(QuickHelperBase.GetCacheFileKeys(), TimeCommon.GetTimeSpan(DateTime.Now), 0, count,
                                            null); //得到过期的key集合
            List <ValueTuple <string, string, string, string> > result = new List <(string, string, string, string)>();

            keyList.ForEach(item =>
            {
                for (int i = 0; i < item.Item2.Length; i += 2)
                {
                    result.Add((item.Item1.Replace(_prefix, ""), item.Item2[i].ToString(),
                                item.Item2[i].ToString().Replace("~_~", "!").Split('!')[0],
                                item.Item2[i].ToString().Replace("~_~", "!").Split('!')[1]));
                }
            });
            return(result);
        }