Skip to content

Commit

Permalink
feat:(1.2.0-beta2): 优化代码
Browse files Browse the repository at this point in the history
  • Loading branch information
open-snail2 committed Oct 24, 2024
1 parent 2e3f020 commit c802009
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,21 +115,21 @@ public void processRetryLogPartitionTasks(List<? extends PartitionTask> partitio
protected void doInTransactionWithoutResult(final TransactionStatus status) {

List<String> uniqueIdIds = StreamUtils.toList(partitionTasks, PartitionTask::getUniqueId);
if (uniqueIdIds == null || uniqueIdIds.size() == 0) {
if (uniqueIdIds == null || uniqueIdIds.isEmpty()) {
return;
}
// Waiting for deletion RetryLog
List<RetryTaskLog> retryTaskLogList = retryTaskLogMapper.selectList(new LambdaQueryWrapper<RetryTaskLog>().in(RetryTaskLog::getUniqueId, uniqueIdIds));
if (retryTaskLogList != null && retryTaskLogList.size() > 0) {
if (retryTaskLogList != null && !retryTaskLogList.isEmpty()) {
List<Long> retryTaskListIds = StreamUtils.toList(retryTaskLogList, RetryTaskLog::getId);
retryTaskLogMapper.deleteBatchIds(retryTaskListIds);
retryTaskLogMapper.deleteByIds(retryTaskListIds);
}

// Waiting for deletion RetryTaskLogMessage
List<RetryTaskLogMessage> retryTaskLogMessageList = retryTaskLogMessageMapper.selectList(new LambdaQueryWrapper<RetryTaskLogMessage>().in(RetryTaskLogMessage::getUniqueId, uniqueIdIds));
if (retryTaskLogMessageList != null && retryTaskLogMessageList.size() > 0) {
if (retryTaskLogMessageList != null && !retryTaskLogMessageList.isEmpty()) {
List<Long> retryTaskListIds = StreamUtils.toList(retryTaskLogMessageList, RetryTaskLogMessage::getId);
retryTaskLogMessageMapper.deleteBatchIds(retryTaskListIds);
retryTaskLogMessageMapper.deleteByIds(retryTaskListIds);
}
}
});
Expand Down

0 comments on commit c802009

Please sign in to comment.