Commit 063364d2 authored by 黎博's avatar 黎博

修改redis配置及新增过期时间

parent 1e7e551a
...@@ -16,6 +16,7 @@ import org.springframework.stereotype.Service; ...@@ -16,6 +16,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import java.util.Map; import java.util.Map;
import java.util.concurrent.TimeUnit;
@Service @Service
...@@ -242,6 +243,7 @@ public class XyqbGenDataServiceImpl implements XyqbGenDataService { ...@@ -242,6 +243,7 @@ public class XyqbGenDataServiceImpl implements XyqbGenDataService {
public void setUserStatusRedisValue(String namespace, String phoneNo, Integer status) { public void setUserStatusRedisValue(String namespace, String phoneNo, Integer status) {
String redisKey = namespace + "_" + phoneNo; String redisKey = namespace + "_" + phoneNo;
redisTemplate.opsForValue().set(redisKey, status); redisTemplate.opsForValue().set(redisKey, status);
redisTemplate.expire(redisKey,1800, TimeUnit.SECONDS);
} }
......
...@@ -13,8 +13,8 @@ spring: ...@@ -13,8 +13,8 @@ spring:
date-format: yyyy-MM-dd HH:mm:ss date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8 time-zone: GMT+8
redis: redis:
host: 172.17.5.5 host: 172.17.5.17
port: 32236 port: 31509
database: 0 database: 0
password: password:
jedis: jedis:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment