usnistgov / oar-pdr

The NIST Open Access to Research (OAR) Public Data Repository (PDR) system software
11 stars 10 forks source link

Handled missing pdrid in metrics #324

Closed chuanlin2018 closed 4 months ago

chuanlin2018 commented 4 months ago

Issue: https://sgitlab.nist.gov/oar-odd/landing-page-service/-/issues/3 Landing page crashed because there was no pdrid in metrics data.

Fix: Added pdrid check in getMetrics() in both landingpage and metrics component.

chuanlin2018 commented 4 months ago

Just checked the fix for metrics page. Still working on landing page side... There are similar code in both page that need be put in a service but will work on it later.

chuanlin2018 commented 4 months ago

All fixed.

chuanlin2018 commented 4 months ago

In metrics page I moved file level metrics code inside record level metrics function because if there is no metrics level data, no need to fetch file level data.

chuanlin2018 commented 4 months ago

Loading metrics data after Nerdm record loaded.

RayPlante commented 4 months ago

Checked on testdata; no issues. Merging.