NUWCDIVNPT / stigman-watcher

A utility that watches a path for test result files on behalf of a STIG Manager Collection
Other
6 stars 4 forks source link

feat: concurrent asset fetches #125

Closed csmig closed 3 months ago

csmig commented 3 months ago

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.

sonarcloud[bot] commented 3 months ago

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 commented 3 months ago

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

cd-rite commented 3 months ago

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