Commit b0852bca authored by zhangyingbin's avatar zhangyingbin

解决redis锁死锁问题

parent 048f37f4
......@@ -34,6 +34,7 @@ import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
......@@ -106,6 +107,25 @@ public class CompanyController extends BaseController {
@Autowired
SuperviseRuleServiceImpl superviseRuleService;
@Autowired
private RedisTemplate redisTemplate;
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/getRedisLock")
@ApiOperation(httpMethod = "get", value = "检查redis锁情况", notes = "检查redis锁情况")
public ResponseModel<Boolean> getRedisLock(){
Boolean lock = redisTemplate.opsForValue().setIfAbsent("lock","1");
return ResponseHelper.buildResponse(lock);
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/deleteRedisLock")
@ApiOperation(httpMethod = "get", value = "删除redis锁", notes = "删除redis锁")
public ResponseModel<Boolean> deleteRedisLock(){
Boolean lock = redisTemplate.delete("lock");
return ResponseHelper.buildResponse(lock);
}
/**
* tzs注册时同步ugp库
*
......
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