Commit 3822dd31 by 徐高华

同步通讯录并发

parent 3907dd3e
...@@ -998,12 +998,19 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ ...@@ -998,12 +998,19 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
logger.info("企微通讯录成员成功:{}", taskId); logger.info("企微通讯录成员成功:{}", taskId);
String key = "haoban_sync_clerk_task_" + taskId; String key = "haoban_sync_clerk_task_" + taskId;
RedisUtil.lock(key, 3L); RedisUtil.lock(key, 3L);
String cacheId = "haoban_sync_clerk_task_cache_"+taskId ;
if(null != RedisUtil.getCache(cacheId)) {
logger.info("进行中,未完成{}", cacheId);
return false ;
}
RedisUtil.setCache(cacheId,1 , 15*60L) ;
TabHaobanSyncTask syncTask = syncTaskService.getSyncTask(taskId); TabHaobanSyncTask syncTask = syncTaskService.getSyncTask(taskId);
String wxEnterpriseId = syncTask.getWxEnterpriseId(); String wxEnterpriseId = syncTask.getWxEnterpriseId();
this.unlockTask(wxEnterpriseId) ; this.unlockTask(wxEnterpriseId) ;
this.cleanDiffrence(wxEnterpriseId, taskId); this.cleanDiffrence(wxEnterpriseId, taskId);
logger.info("同步通讯录完成"); logger.info("同步通讯录完成");
String conectkey = "get_follow_user_list:"+wxEnterpriseId ; String conectkey = "get_follow_user_list:"+wxEnterpriseId ;
RedisUtil.delCache(cacheId) ;
RedisUtil.delCache(conectkey) ; RedisUtil.delCache(conectkey) ;
RedisUtil.unlock(key); RedisUtil.unlock(key);
} }
......
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