redis设置过期时间:
set key value
expire key 1200 返回1表示成功,返回0表示键不存在或者设置失败
ttl key 查看key的过期时间,键不存在返回-2,没有过期时间为-1
persist key 取消过期时间的限制
redis设置过期时间:
set key value
expire key 1200 返回1表示成功,返回0表示键不存在或者设置失败
ttl key 查看key的过期时间,键不存在返回-2,没有过期时间为-1
persist key 取消过期时间的限制
转载于:https://my.oschina.net/xxbAndy/blog/657953