fix: CpImageStorePersonSynManager cleared (12→0) via RedisCallback re-apply

Total: 200→122→110 (-90, -45%)
This commit is contained in:
反编译工作区
2026-05-06 00:38:17 +08:00
parent 9234c98ef2
commit 1352850cc3
@@ -27,7 +27,9 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import org.springframework.data.redis.core.RedisCallback;
import javax.annotation.PostConstruct;
import org.springframework.data.redis.core.RedisCallback;
import javax.annotation.Resource;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -463,22 +465,22 @@ return ((List<AgImageStoreResult>)waitSyncImageStoreChangeResult.getData()).get(
}
public Long addWaitSynTask(String imageStoreId, String jsonData) {
this.logger.info("addWaitSynTask - 图库待同步任务队列队尾新增任务 imageStoreId{}; jsonData: {}", imageStoreId, jsonData);
return (Long)this.redisTemplate.execute(connection -> (Long)connection.eval(this.addWaitSynTaskRedisScript.getScriptAsString().getBytes(), ReturnType.INTEGER, 0, new byte[][] { imageStoreId.getBytes(), jsonData.getBytes() }));
return (Long)this.redisTemplate.execute((RedisCallback) connection -> (Long)connection.eval(this.addWaitSynTaskRedisScript.getScriptAsString().getBytes(), ReturnType.INTEGER, 0, new byte[][] { imageStoreId.getBytes(), jsonData.getBytes() }));
}
public Long lockHandleSynTask(String imageStoreId) {
return (Long)this.redisTemplate.execute(connection -> (Long)connection.eval(this.lockHandleSynTaskRedisScript.getScriptAsString().getBytes(), ReturnType.INTEGER, 0, new byte[][] { imageStoreId.getBytes(), this.serverInstanceId.getBytes(), this.lockHandleSynTaskSecond.getBytes() }));
return (Long)this.redisTemplate.execute((RedisCallback) connection -> (Long)connection.eval(this.lockHandleSynTaskRedisScript.getScriptAsString().getBytes(), ReturnType.INTEGER, 0, new byte[][] { imageStoreId.getBytes(), this.serverInstanceId.getBytes(), this.lockHandleSynTaskSecond.getBytes() }));
}
public Long lockHeadSynTask(String imageStoreId) {
return (Long)this.redisTemplate.execute(connection -> (Long)connection.eval(this.lockHeadSynTaskRedisScript.getScriptAsString().getBytes(), ReturnType.INTEGER, 1, new byte[][] { imageStoreId.getBytes(), imageStoreId.getBytes(), this.serverInstanceId.getBytes(), String.valueOf(this.taskIsAllThreshold).getBytes() }));
return (Long)this.redisTemplate.execute((RedisCallback) connection -> (Long)connection.eval(this.lockHeadSynTaskRedisScript.getScriptAsString().getBytes(), ReturnType.INTEGER, 1, new byte[][] { imageStoreId.getBytes(), imageStoreId.getBytes(), this.serverInstanceId.getBytes(), String.valueOf(this.taskIsAllThreshold).getBytes() }));
}
public Long handleSuccessSynTask(String imageStoreId) {
return (Long)this.redisTemplate.execute(connection -> (Long)connection.eval(this.handleSuccessSynTaskRedisScript.getScriptAsString().getBytes(), ReturnType.INTEGER, 0, new byte[][] { imageStoreId.getBytes(), this.serverInstanceId.getBytes() }));
return (Long)this.redisTemplate.execute((RedisCallback) connection -> (Long)connection.eval(this.handleSuccessSynTaskRedisScript.getScriptAsString().getBytes(), ReturnType.INTEGER, 0, new byte[][] { imageStoreId.getBytes(), this.serverInstanceId.getBytes() }));
}
public Long handleFailSynTask(String imageStoreId) {
return (Long)this.redisTemplate.execute(connection -> (Long)connection.eval(this.handleFailSynTaskRedisScript.getScriptAsString().getBytes(), ReturnType.INTEGER, 0, new byte[][] { imageStoreId.getBytes(), this.serverInstanceId.getBytes() }));
return (Long)this.redisTemplate.execute((RedisCallback) connection -> (Long)connection.eval(this.handleFailSynTaskRedisScript.getScriptAsString().getBytes(), ReturnType.INTEGER, 0, new byte[][] { imageStoreId.getBytes(), this.serverInstanceId.getBytes() }));
}
public void refreshHandleSynTaskLockExpireTime() {
byte[] res = (byte[])this.redisTemplate.execute(connection -> (byte[])connection.eval(this.refreshHandleSynTaskRedisScript.getScriptAsString().getBytes(), ReturnType.VALUE, 0, new byte[][] { this.serverInstanceId.getBytes(), this.lockHandleSynTaskSecond.getBytes() }));
byte[] res = (byte[])this.redisTemplate.execute((RedisCallback) connection -> (byte[])connection.eval(this.refreshHandleSynTaskRedisScript.getScriptAsString().getBytes(), ReturnType.VALUE, 0, new byte[][] { this.serverInstanceId.getBytes(), this.lockHandleSynTaskSecond.getBytes() }));
this.logger.info("CpImageStorePersonSynManager refreshHandleSynTaskLockExpireTime : {}", new String(res));
}
public void checkHandleSynTaskException() {