Skip to content

Commit

Permalink
Merge pull request #1110 from zacYL/issue_1109
Browse files Browse the repository at this point in the history
bug: 仓库限速判断逻辑先临时忽略因仓库类型不匹配而抛出仓库找不到的异常#1109
  • Loading branch information
owenlxu authored Aug 30, 2023
2 parents eee7445 + 22d7ebb commit b0fbe2c
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,9 @@ class ArtifactContextHolder(
require(repoRateLimitAttribute is RateLimitProperties)
return repoRateLimitAttribute
}
val repo = getRepoDetail() ?: return RateLimitProperties()
// 临时下载链接可能会使用 generic 下载其他业务类型的制品,此处先避免仓库找不到异常
// 此处修改潜在风险:当其他类型仓库使用 generic 服务的临时下载链接下载时无法控制住
val repo = getRepoDetailOrNull() ?: return RateLimitProperties()
val receiveRateLimit = convertToDataSize(repo.configuration.getStringSetting(RECEIVE_RATE_LIMIT_OF_REPO))
val responseRateLimit = convertToDataSize(repo.configuration.getStringSetting(RESPONSE_RATE_LIMIT_OF_REPO))
val rateLimitProperties = RateLimitProperties(receiveRateLimit, responseRateLimit)
Expand Down

0 comments on commit b0fbe2c

Please sign in to comment.