Skip to content

Commit

Permalink
Gracefully disable useRequest() cache when no request is active
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerHendrickson committed Sep 30, 2023
1 parent dc6bbc1 commit b1c8ecf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/server/src/arpa_reporter/services/records.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ async function loadRecordsForUpload(upload) {
async function recordsForUpload(upload, req = useRequest()) {
log(`recordsForUpload(${upload.id})`);

if (req === undefined) {
// Will not cache outside of a request
req = {};
}

if (!req.recordsForUpload) {
req.recordsForUpload = {};
}
Expand Down

0 comments on commit b1c8ecf

Please sign in to comment.