-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: npm远程仓库优化 #1168 #1173
base: master
Are you sure you want to change the base?
Conversation
@@ -177,7 +175,7 @@ abstract class RemoteRepository : AbstractArtifactRepository() { | |||
val size = artifactFile.getSize() | |||
val artifactStream = artifactFile.getInputStream().artifactStream(Range.full(size)) | |||
val node = cacheArtifactFile(context, artifactFile) | |||
return ArtifactResource(artifactStream, context.artifactInfo.getResponseName(), node, ArtifactChannel.LOCAL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里是本地下载,为什么要改成PROXY呢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里是onDownloadResponse方法,都是远程下载的
@@ -115,21 +115,19 @@ abstract class RemoteRepository : AbstractArtifactRepository() { | |||
/** | |||
* 尝试读取缓存的远程构件 | |||
*/ | |||
fun getCacheArtifactResource(context: ArtifactDownloadContext): ArtifactResource? { | |||
open fun getCacheArtifactResource(context: ArtifactContext): ArtifactResource? { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里是为什么要把ArtifactDownloadContext换成ArtifactContext呢,这里应该是处理下载上下文
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
查询元数据文件时使用的是ArtifactQueryContext,也会读取和缓存文件,且其它类型仓库也有类似的行为,因此扩大了这个方法的使用范围。
issue:
描述: