Skip to content

Commit

Permalink
Reduce date range for API reports to speed up processing
Browse files Browse the repository at this point in the history
  • Loading branch information
levinmr committed Aug 23, 2024
1 parent 2abf19b commit c3be15b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
7 changes: 4 additions & 3 deletions deploy/backload.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ const api_run = () => {
const iterationTargetDate = subDays(new Date(), totalDaysAgo);

const iterationDaysAgo = differenceInDays(today, iterationTargetDate) + 1;
const modifiedApiJsonString = JSON.stringify(apiReports)
.replaceAll('"yesterday"', `"${iterationDaysAgo}daysAgo"`)
.replaceAll('"3daysAgo"', `"${iterationDaysAgo}daysAgo"`);
const modifiedApiJsonString = JSON.stringify(apiReports).replaceAll(
'"yesterday"',
`"${iterationDaysAgo}daysAgo"`,
);

fs.unlinkSync("reports/api.json");
fs.writeFileSync("reports/api.original.json", JSON.stringify(apiReports));
Expand Down
26 changes: 13 additions & 13 deletions reports/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
],
"dateRanges": [
{
"startDate": "3daysAgo",
"startDate": "yesterday",
"endDate": "yesterday"
}
],
Expand Down Expand Up @@ -67,7 +67,7 @@
],
"dateRanges": [
{
"startDate": "3daysAgo",
"startDate": "yesterday",
"endDate": "yesterday"
}
],
Expand Down Expand Up @@ -115,7 +115,7 @@
],
"dateRanges": [
{
"startDate": "3daysAgo",
"startDate": "yesterday",
"endDate": "yesterday"
}
],
Expand Down Expand Up @@ -163,7 +163,7 @@
],
"dateRanges": [
{
"startDate": "3daysAgo",
"startDate": "yesterday",
"endDate": "yesterday"
}
],
Expand Down Expand Up @@ -211,7 +211,7 @@
],
"dateRanges": [
{
"startDate": "3daysAgo",
"startDate": "yesterday",
"endDate": "yesterday"
}
],
Expand Down Expand Up @@ -267,7 +267,7 @@
],
"dateRanges": [
{
"startDate": "3daysAgo",
"startDate": "yesterday",
"endDate": "yesterday"
}
],
Expand Down Expand Up @@ -318,7 +318,7 @@
],
"dateRanges": [
{
"startDate": "3daysAgo",
"startDate": "yesterday",
"endDate": "yesterday"
}
],
Expand Down Expand Up @@ -369,7 +369,7 @@
],
"dateRanges": [
{
"startDate": "3daysAgo",
"startDate": "yesterday",
"endDate": "yesterday"
}
],
Expand Down Expand Up @@ -425,7 +425,7 @@
],
"dateRanges": [
{
"startDate": "3daysAgo",
"startDate": "yesterday",
"endDate": "yesterday"
}
],
Expand Down Expand Up @@ -476,7 +476,7 @@
],
"dateRanges": [
{
"startDate": "3daysAgo",
"startDate": "yesterday",
"endDate": "yesterday"
}
],
Expand Down Expand Up @@ -524,7 +524,7 @@
],
"dateRanges": [
{
"startDate": "3daysAgo",
"startDate": "yesterday",
"endDate": "yesterday"
}
],
Expand Down Expand Up @@ -582,7 +582,7 @@
],
"dateRanges": [
{
"startDate": "3daysAgo",
"startDate": "yesterday",
"endDate": "yesterday"
}
],
Expand Down Expand Up @@ -639,7 +639,7 @@
],
"dateRanges": [
{
"startDate": "3daysAgo",
"startDate": "yesterday",
"endDate": "yesterday"
}
],
Expand Down

0 comments on commit c3be15b

Please sign in to comment.