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

Reduce final state for bulk/bulkGetCases-HH.js job #119

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions bulk/bulkGetCases-HH.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ fn(state => {
const caseTypes = ['Household'];

//NOTE: You can use 'limit' to modify this batch size as desired
const limit = 1000;
const limit = 1000;

//NOTE: indexedOnStart is the default sync start data the FIRST time the job runs
const indexedOnStart = '2023-01-15T10:00:00';
Expand All @@ -13,13 +13,14 @@ fn(state => {
const lastRunAt =
typeof state.lastRunAt !== 'undefined' ? state.lastRunAt : indexedOnStart;
console.log('Filtering cases with indexed_on_start > than ::', lastRunAt);
//May 31st, 2023 at 3:00:13 PM.
//May 31st, 2023 at 3:00:13 PM.
const queries = caseTypes.map(
// t => `?type=${t}&indexed_on_start=${lastRunAt}&limit=${limit}`
// t => `?type=${t}&indexed_on_start=${lastRunAt}&limit=${limit}`
//NOTE: If for testing, you want to fetch data for a specific historical range (e.g., between April 23 and 24)...
//...then use the query string below instead of the one above on L16, and custom adjust the index_on start/end dates
//t => `?type=${t}&indexed_on_start=2023-03-03T00:00:00&limit=${limit}&indexed_on_end=2023-03-06T00:00:00` //returns 14 records
t => `?type=${t}&indexed_on_start=2023-01-11T18:00:00&limit=${limit}&indexed_on_end=2023-01-15T16:59:59`
t =>
`?type=${t}&indexed_on_start=2023-01-11T18:00:00&limit=${limit}&indexed_on_end=2023-01-15T16:59:59`
);

return { ...state, queries, baseUrl, payloads: [] };
Expand Down Expand Up @@ -69,5 +70,5 @@ each(
fn(state => {
console.log('Count of payloads', state.payloads.length);

return { ...state, references: [], data: {} };
});
return { ...state, references: [], data: {}, response: {} };
});