java memcachedClient 存储有效期方法,切记

来源:互联网 发布:淘宝网怎么绑定信用卡 编辑:程序博客网 时间:2024/05/20 22:27

正确使用方式:

Memcached.setString("ceshi", "ceshi", new Date(60*60*1000));


错误使用方式:

Memcached.setString("ceshi", "ceshi", new Date(System.currentTimeMillis()+60*60*1000));

System.currentTimeMillis()就因为这个导致本人操作一直不能把数据存入Memcached

0 0
原创粉丝点击