/// <summary> /// 重置缓存数据过期时间 /// </summary> /// <param name="pattern">通配符</param> /// <param name="addSeconds">更新的过期时间</param> /// <returns>是否成功</returns> public bool ResetAllExpireTime(string pattern, int addSeconds = 3600) { try { var keys = _redisClient.Keys(pattern); if (keys == null || keys.Length == 0) { return(false); } foreach (var key in keys) { _redisClient.ExpireAt(key, DateTime.Now.AddSeconds(addSeconds)); } return(true); } catch (Exception e) { return(false); } }