Commit 9d52beec by fudahua

导购刷新好友超时时间

parent 069b30fe
......@@ -31,6 +31,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@Service
......@@ -202,14 +203,22 @@ public class FriendSyncNewOperation implements BaseSyncOperation {
return;
}
logger.info("同步第三方服务商好友结束:{},{}", taskId, pDataId);
String key = "haoban_sync_third_friend_task_" + taskId;
RedisUtil.lock(key, 3L);
String key = "haoban_sync_third_friend_task_" + taskId + ":" + pDataId;
String lockKey = "haoban_sync_third_friend_task_lock_" + taskId + ":" + pDataId;
RedisUtil.lock(lockKey, 3L);
Object hasDealCheck = RedisUtil.getCache(key);
if (hasDealCheck != null) {
logger.info("重复提交结束第三方好友:{}", pDataId);
RedisUtil.unlock(lockKey);
return;
}
RedisUtil.setCache(key, pDataId, 1L, TimeUnit.MINUTES);
TabHaobanPreDealLog preDealLog = preDealService.getByDataId(taskId, pDataId, PreDealTypeEnum.friend_clerk.getVal(), PreDealStatusEnum.dealing.getVal());
if (preDealLog != null) {
preDealService.updateStatusByDataId(taskId, pDataId, PreDealTypeEnum.friend_clerk.getVal(), PreDealStatusEnum.computed.getVal(), "成功");
this.checkDepartmentTask(taskId);
}
RedisUtil.unlock(key);
RedisUtil.unlock(lockKey);
}
@Override
......
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