拉取关联关系优化

dev_drug
qiuyt 3 months ago
parent 42d38220e2
commit f1fce0806b

@ -766,7 +766,7 @@ public class RelCodeBatchService extends ServiceImpl<RelCodeBatchMapper, RelCode
new QueryWrapper<RelCodeBatch>().eq("curCode",code)
);
if(Objects.isNull(relCodeBatch)){
redisDelayedQueue.addTaskToQueue(code+"&&&"+erpId,relCodeDelaySeconds);
redisDelayedQueue.addTaskToQueue(code+"&&&"+erpId,relCodeDelaySeconds,"rel_code_queue");
}else {
log.error("有关联关系了此码==="+code);
}

@ -15,9 +15,9 @@ public class RedisDelayedQueue {
// 将任务加入延时队列
public void addTaskToQueue(String taskId, long delaySeconds) {
public void addTaskToQueue(String taskId, long delaySeconds,String queueName) {
long timestamp = System.currentTimeMillis() / 1000 + delaySeconds; // 计算任务执行的时间戳
jedis.zadd("rel_code_queue", timestamp, taskId); // 将任务添加到有序集合score 为任务的执行时间戳
jedis.zadd(queueName, timestamp, taskId); // 将任务添加到有序集合score 为任务的执行时间戳
System.out.println("Task " + taskId + " added to queue with " + delaySeconds + " seconds delay.");
}

Loading…
Cancel
Save