Feat/curse retry and cache - #6595
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 273baf1140
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return file; | ||
| } catch (IOException | JsonParseException e) { | ||
| LOG.warning("Unable to fetch the file name projectID=" + file.projectID() + ", fileID=" + file.fileID(), e); | ||
| if (StringUtils.isBlank(file.fileName()) || file.url() == null || file.hashes() == null || file.hashes().isEmpty()) { |
There was a problem hiding this comment.
Keep missing hashes from invalidating completed manifests
When upgrading a manifest enriched by an earlier HMCL version, fileName and url are already usable but hashes is absent, so this condition now forces another CurseForge API request. If that request remains temporarily unavailable after the retries, or the API record was deleted while the CDN URL still works, the code sets allNameKnown/notFound and postExecute() fails the entire completion with ModpackCompletionException, even though the existing metadata is sufficient to download or retain the file. Hash enrichment should remain optional when the name and URL are already known.
Useful? React with 👍 / 👎.
273baf1 to
7e0f3eb
Compare
添加对api.curseforge.com的自动重试
修改原因:发现ATM这种整合包如果请求一个mod因为网络抖动失败(例如 projectID: 123456, fileID: 789012
请求api.curseforge.com/v1/mods/123456/files/789012)就会导致整个整合包升级失败
并在manifest.json中添加hashes字段实现curse类整合包mod下载的缓存利用