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

栏目: ASP.NET · 发布时间: 7年前

内容简介:引用:在比对了多次配置文件后,终于发现了一点蹊跷,在配置中不能有与之相冲的配置,于是处理方法就很简单了。将无关监听事件注释,再把自己需要的取消注释,即可让监听事件生效

引用: 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 服务即可让过期键监听事件生效。


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Ajax for Web Application Developers

Ajax for Web Application Developers

Kris Hadlock / Sams / 2006-10-30 / GBP 32.99

Book Description Reusable components and patterns for Ajax-driven applications Ajax is one of the latest and greatest ways to improve users’ online experience and create new and innovative web f......一起来看看 《Ajax for Web Application Developers》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具