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

Feat/peregrine request chunk #699

Merged
merged 13 commits into from
Jun 23, 2020
Merged

Feat/peregrine request chunk #699

merged 13 commits into from
Jun 23, 2020

Conversation

ZakirG
Copy link
Contributor

@ZakirG ZakirG commented Jun 21, 2020

This PR splits the query for homepage chart nodes into multiple queries when more than 15 nodes are requested. The chunked query results are combined and rendered. You can run my unit tests with
npm test src/Index/utils.test.js

Deployed in https://zakir.planx-pla.net/

Fulfills https://ctds-planx.atlassian.net/browse/PXP-6235

Improvements

  • Homepage chart data request is now chunked to respect Postgres query limits

Deployment Changes

  • New optional config field in the index section of gitops.json called homepageChartNodeChunkSize. Sets the value for paritioning requests to Peregrine for the homepage chart. Defaults to 15 if not provided.

Copy link
Collaborator

@mfshao mfshao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice implementaion and tests

src/Index/utils.js Outdated Show resolved Hide resolved
.catch((err) => {
console.log(err);
});
return;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also print something for other errors?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure that's desirable? The original functionality did not print something for the other errors. If a query comes back with status code 500, I don't think a console print stating "The homepage chart node query came back with status code 500" would be desirable, or consistent with our usual error handling style in this repo.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't have any strong feeling about it. but i think it would be more helpful to know what went wrong, plus we are already printing some error messages in other functions

src/Index/utils.js Outdated Show resolved Hide resolved
Copy link
Collaborator

@mfshao mfshao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, please add some comment regarding the optional config field into the PR template so everyone else would know

.catch((err) => {
console.log(err);
});
return;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't have any strong feeling about it. but i think it would be more helpful to know what went wrong, plus we are already printing some error messages in other functions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants