MCPcopy Create free account
hub / github.com/PlexPt/rocket-pt / setEx

Method setEx

src/main/java/com/rocketpt/server/util/RedisUtil.java:281–283  ·  view source on GitHub ↗

将值 value 关联到 key ,并将 key 的过期时间设为 timeout @param key @param value @param timeout 过期时间 @param unit 时间单位, 天:TimeUnit.DAYS 小时:TimeUnit.HOURS 分钟:TimeUnit.MINUTES 秒:TimeUnit.SECONDS 毫秒:TimeUnit.MILLISECONDS

(String key, String value, long timeout, TimeUnit unit)

Source from the content-addressed store, hash-verified

279 * 秒:TimeUnit.SECONDS 毫秒:TimeUnit.MILLISECONDS
280 */
281 public void setEx(String key, String value, long timeout, TimeUnit unit) {
282 redisTemplate.opsForValue().set(key, value, timeout, unit);
283 }
284
285 /**
286 * 只有在 key 不存在时设置 key 的值

Callers 2

setMailCodeMethod · 0.80
checkEmailCodeMethod · 0.80

Calls 1

setMethod · 0.45

Tested by

no test coverage detected