update 定时任务中算力相关计算封装为策略+工厂模式
This commit is contained in:
@@ -2,6 +2,7 @@ package com.m2pool.lease.redis.service;//package com.m2pool.lease.redis.service;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.data.redis.connection.DataType;
|
||||
import org.springframework.data.redis.core.BoundSetOperations;
|
||||
import org.springframework.data.redis.core.HashOperations;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
@@ -314,8 +315,8 @@ public class RedisService {
|
||||
// 先判断 key 是否存在
|
||||
if (redisTemplate7.hasKey(key)) {
|
||||
// 检查 key 的类型是否为 Hash
|
||||
org.springframework.data.redis.core.DataType dataType = redisTemplate7.type(key);
|
||||
if (dataType == org.springframework.data.redis.core.DataType.HASH) {
|
||||
DataType dataType = redisTemplate7.type(key);
|
||||
if (dataType == DataType.HASH) {
|
||||
// 再判断 hKey 是否存在
|
||||
if (redisTemplate7.opsForHash().hasKey(key, hKey)) {
|
||||
redisTemplate7.opsForHash().delete(key, hKey);
|
||||
|
||||
Reference in New Issue
Block a user