mirror of
https://github.com/hpd840321/starRiverProperty.git
synced 2026-06-09 08:20:31 +08:00
fix: CpImageStorePersonSynManager cleared (12→0) via RedisCallback re-apply
Total: 200→122→110 (-90, -45%)
This commit is contained in:
+8
-6
@@ -27,7 +27,9 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import org.springframework.data.redis.core.RedisCallback;
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
|
import org.springframework.data.redis.core.RedisCallback;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -463,22 +465,22 @@ return ((List<AgImageStoreResult>)waitSyncImageStoreChangeResult.getData()).get(
|
|||||||
}
|
}
|
||||||
public Long addWaitSynTask(String imageStoreId, String jsonData) {
|
public Long addWaitSynTask(String imageStoreId, String jsonData) {
|
||||||
this.logger.info("addWaitSynTask - 图库待同步任务队列队尾新增任务 imageStoreId:{}; jsonData: {}", imageStoreId, 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) {
|
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) {
|
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) {
|
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) {
|
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() {
|
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));
|
this.logger.info("CpImageStorePersonSynManager refreshHandleSynTaskLockExpireTime : {}", new String(res));
|
||||||
}
|
}
|
||||||
public void checkHandleSynTaskException() {
|
public void checkHandleSynTaskException() {
|
||||||
|
|||||||
Reference in New Issue
Block a user