1.优化 iwork 同步用户效率
This commit is contained in:
@@ -9,6 +9,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Collections;
|
||||
|
||||
@Mapper
|
||||
public interface PostMapper extends BaseMapperX<PostDO> {
|
||||
@@ -35,4 +36,12 @@ public interface PostMapper extends BaseMapperX<PostDO> {
|
||||
return selectOne(PostDO::getCode, code);
|
||||
}
|
||||
|
||||
default List<PostDO> selectByCodes(Collection<String> codes) {
|
||||
if (codes == null || codes.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return selectList(new LambdaQueryWrapperX<PostDO>()
|
||||
.in(PostDO::getCode, codes));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -217,11 +217,14 @@ public class IWorkSyncServiceImpl implements IWorkSyncService {
|
||||
int pagesLimit = reqVO.getMaxPages() == null ? Integer.MAX_VALUE : reqVO.getMaxPages();
|
||||
int processedPages = 0;
|
||||
for (int page = startPage; processedPages < pagesLimit; page++) {
|
||||
long pageStart = System.currentTimeMillis();
|
||||
BatchExecution execution = executor.execute(page, pageSize);
|
||||
long pageMs = System.currentTimeMillis() - pageStart;
|
||||
if (execution == null || execution.totalPulled == 0) {
|
||||
break;
|
||||
}
|
||||
processedPages++;
|
||||
log.info("[iWork] 全量同步 {} 页={} pulled={} costMs={}", type, page, execution.totalPulled, pageMs);
|
||||
IWorkSyncBatchStatVO batchStat = new IWorkSyncBatchStatVO();
|
||||
batchStat.setEntityType(type);
|
||||
batchStat.setPageNumber(page);
|
||||
@@ -403,11 +406,14 @@ public class IWorkSyncServiceImpl implements IWorkSyncService {
|
||||
int pagesLimit = reqVO.getMaxPages() == null ? Integer.MAX_VALUE : reqVO.getMaxPages();
|
||||
int processedPages = 0;
|
||||
for (int page = startPage; processedPages < pagesLimit; page++) {
|
||||
long pageStart = System.currentTimeMillis();
|
||||
BatchExecution execution = executor.execute(page, pageSize);
|
||||
long pageMs = System.currentTimeMillis() - pageStart;
|
||||
if (execution == null || execution.totalPulled == 0) {
|
||||
break;
|
||||
}
|
||||
processedPages++;
|
||||
log.info("[iWork] 手动同步 {} 页={} pulled={} costMs={}", type, page, execution.totalPulled, pageMs);
|
||||
IWorkSyncBatchStatVO batchStat = new IWorkSyncBatchStatVO();
|
||||
batchStat.setEntityType(type);
|
||||
batchStat.setPageNumber(page);
|
||||
|
||||
Reference in New Issue
Block a user