Skip to content

Commit

Permalink
feat: 增加降冷任务配置页面 #2564
Browse files Browse the repository at this point in the history
  • Loading branch information
lannoy0523 committed Nov 11, 2024
1 parent 1482351 commit c907641
Showing 1 changed file with 20 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,12 @@ class SeparationTaskServiceImpl(
) {
var flag = false
val projectRepoKey = "${projectId}/${repoName}"
// dataSeparationConfig.specialRestoreRepos.forEach {
// val regex = Regex(it.replace("*", ".*"))
// if (regex.matches(projectRepoKey)) {
// flag = true
// }
// }
flag = true
dataSeparationConfig.specialRestoreRepos.forEach {
val regex = Regex(it.replace("*", ".*"))
if (regex.matches(projectRepoKey)) {
flag = true
}
}
if (!flag) throw BadRequestException(
CommonMessageCode.PARAMETER_INVALID,
projectRepoKey
Expand Down Expand Up @@ -212,13 +211,12 @@ class SeparationTaskServiceImpl(

var flag = false
val projectRepoKey = "$projectId/$repoName"
// dataSeparationConfig.specialSeparateRepos.forEach {
// val regex = Regex(it.replace("*", ".*"))
// if (regex.matches(projectRepoKey)) {
// flag = true
// }
// }
flag = true
dataSeparationConfig.specialSeparateRepos.forEach {
val regex = Regex(it.replace("*", ".*"))
if (regex.matches(projectRepoKey)) {
flag = true
}
}
if (!flag) throw BadRequestException(
CommonMessageCode.PARAMETER_INVALID,
projectRepoKey
Expand Down Expand Up @@ -250,14 +248,14 @@ class SeparationTaskServiceImpl(
RepositoryType.GENERIC -> SeparationArtifactType.NODE
else -> SeparationArtifactType.PACKAGE
}
// if (!request.content.packages.isNullOrEmpty() && separationArtifactType == SeparationArtifactType.NODE) {
// logger.warn("Separation content [${request.content}] is illegal!")
// throw BadRequestException(CommonMessageCode.PARAMETER_INVALID)
// }
// if (!request.content.paths.isNullOrEmpty() && separationArtifactType == SeparationArtifactType.PACKAGE) {
// logger.warn("Separation content [${request.content}] is illegal!")
// throw BadRequestException(CommonMessageCode.PARAMETER_INVALID)
// }
if (!request.content.packages.isNullOrEmpty() && separationArtifactType == SeparationArtifactType.NODE) {
logger.warn("Separation content [${request.content}] is illegal!")
throw BadRequestException(CommonMessageCode.PARAMETER_INVALID)
}
if (!request.content.paths.isNullOrEmpty() && separationArtifactType == SeparationArtifactType.PACKAGE) {
logger.warn("Separation content [${request.content}] is illegal!")
throw BadRequestException(CommonMessageCode.PARAMETER_INVALID)
}
}

private fun buildSeparationTask(
Expand Down

0 comments on commit c907641

Please sign in to comment.