加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

C# Redis 过期机制不生效问题

发布时间:2020-12-15 04:54:35 所属栏目:百科 来源:网络整理
导读:引用:https://ask.csdn.net/questions/358802 根据这里的代码写出监听事件后,事件并没有生效 在比对了多次配置文件后,终于发现了一点蹊跷,在配置中不能有与之相冲的配置,于是处理方法就很简单了。 将无关监听事件注释,再把自己需要的取消注释,即可让监

引用:https://ask.csdn.net/questions/358802 根据这里的代码写出监听事件后,事件并没有生效

在比对了多次配置文件后,终于发现了一点蹊跷,在配置中不能有与之相冲的配置,于是处理方法就很简单了。

将无关监听事件注释,再把自己需要的取消注释,即可让监听事件生效

# The "notify-keyspace-events" takes as argument a string that is composed

# of zero or multiple characters. The empty string means that notifications

# are disabled.

#

# Example: to enable list and generic events,from the point of view of the

# event name,use:

#

# notify-keyspace-events Elg #被注释的代码

#

# Example 2: to get the stream of the expired keys subscribing to channel

# name __keyevent@0__:expired use:

#

#被取消注释的代码

notify-keyspace-events Ex

保存配置后,重启Redis服务即可让过期键监听事件生效。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读