您的位置:首页 > 数据库 > Memcache

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

2016-06-15 21:40 351 查看
正确使用方式:

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

错误使用方式:

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

System.currentTimeMillis()就因为这个导致本人操作一直不能把数据存入Memcached
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: