Skip to content

Commit

Permalink
feat: 恢复路径解析调整#2754
Browse files Browse the repository at this point in the history
  • Loading branch information
zacYL committed Nov 19, 2024
1 parent fd3e10e commit 52bf28b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import com.tencent.bkrepo.common.mongo.util.Pages
import com.tencent.bkrepo.common.security.util.SecurityUtils
import com.tencent.bkrepo.job.RESTORE
import com.tencent.bkrepo.job.SEPARATE
import com.tencent.bkrepo.job.SEPARATION_TASK_COLLECTION_NAME
import com.tencent.bkrepo.job.separation.config.DataSeparationConfig
import com.tencent.bkrepo.job.separation.dao.SeparationFailedRecordDao
import com.tencent.bkrepo.job.separation.dao.SeparationTaskDao
Expand Down Expand Up @@ -100,10 +99,10 @@ class SeparationTaskServiceImpl(
projectId?.apply { criteria.and(TSeparationTask::projectId.name).isEqualTo(projectId) }
repoName?.apply { criteria.and(TSeparationTask::repoName.name).isEqualTo(repoName) }
val query = Query(criteria)
val dateRecords = mongoTemplate.findDistinct(
query, TSeparationTask::separationDate.name, SEPARATION_TASK_COLLECTION_NAME, LocalDateTime::class.java
)
result.addAll(dateRecords)
val dateRecords = mongoTemplate.find(query, TSeparationTask::class.java)
dateRecords.forEach {
result.add(it.separationDate)
}
return result
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import com.tencent.bkrepo.job.separation.pojo.query.NodeDetailInfo
import com.tencent.bkrepo.job.separation.service.RepoSpecialDataSeparator
import com.tencent.bkrepo.job.separation.util.SeparationUtils
import com.tencent.bkrepo.job.separation.util.SeparationUtils.getNodeCollectionName
import com.tencent.bkrepo.maven.util.MavenGAVCUtils.toMavenGAVC
import com.tencent.bkrepo.maven.util.MavenGAVCUtils.mavenGAVC
import com.tencent.bkrepo.maven.util.MavenStringUtils.formatSeparator
import com.tencent.bkrepo.maven.util.MavenUtil.extractGroupIdAndArtifactId
import com.tencent.bkrepo.maven.util.MavenUtil.extractPath
Expand Down Expand Up @@ -210,7 +210,7 @@ class MavenRepoSpecialDataSeparatorHandler(

override fun getRecoveryPackageVersionData(recoveryInfo: RecoveryNodeInfo): RecoveryVersionInfo {
with(recoveryInfo) {
val mavenGAVC = fullPath.toMavenGAVC()
val mavenGAVC = fullPath.mavenGAVC()
val version = mavenGAVC.version
val artifactId = mavenGAVC.artifactId
val groupId = mavenGAVC.groupId.formatSeparator("/", ".")
Expand Down

0 comments on commit 52bf28b

Please sign in to comment.