Speed up artifact downloads

This commit is contained in:
npc0-hue
2026-09-03 11:27:19 +08:00
parent a82f1ff01a
commit 6311eb72ba
10 changed files with 142 additions and 83 deletions
+5 -1
View File
@@ -76,7 +76,11 @@ func (svc *CoreService) ReadArtifactContentForSession(sessionID string, request
}
limit := request.Limit
if limit == 0 {
limit = validator.MaxArtifactDownloadBytes
if request.Offset == 0 {
limit = int(artifact.SizeBytes)
} else {
limit = validator.MaxArtifactDownloadBytes
}
}
if request.Offset > artifact.SizeBytes {
return domain.ArtifactContent{}, validationError("artifact range exceeds metadata")