Skip to content
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

feat: concurrent asset fetches #125

Merged
merged 5 commits into from
Jun 13, 2024
Merged

feat: concurrent asset fetches #125

merged 5 commits into from
Jun 13, 2024

Conversation

csmig
Copy link
Member

@csmig csmig commented Jun 10, 2024

Resolves #124
Resolves #118

This PR refactors cargo.js and api.js to support more efficient fetches of Assets from the STIG Manager API. Instead of each batch fetching all the Assets for the target Collection, each batch will fetch only those Assets which are targets of the batch's parsed results.

In addition, the error handling for apiRequest() was refactrored to align with the real-world behavior of the API, which returns 422 upon duplicate name collisions and 503 when the service is unavailable.

Copy link

Quality Gate Passed Quality Gate passed for 'NUWCDIVNPT_stigman-watcher'

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@Matte22
Copy link
Collaborator

Matte22 commented Jun 11, 2024

I've reviewed the code and used my smaller sets of data for testing. All looks good to me !

@cd-rite
Copy link
Collaborator

cd-rite commented Jun 12, 2024

Looks good to me. Seems to perform a lot better:
Imported 400 ckls into a collection of 264 assets:
Old way, with the big GET: ~2:10
New, with targeted GETs: ~1:10

@csmig csmig merged commit 1009021 into main Jun 13, 2024
3 checks passed
@csmig csmig deleted the concurrent-asset-fetches branch June 13, 2024 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants