Skip to content

Commit

Permalink
RN-635: Added warnings about manual analytics refreshes where it's be…
Browse files Browse the repository at this point in the history
…ing done
  • Loading branch information
rohan-bes committed Sep 2, 2022
1 parent e3f19e1 commit 19dff97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/central-server/src/apiV2/postChanges.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ export async function postChanges(req, res) {
await ACTION_HANDLERS[action](models, translatedPayload);

if (action === SUBMIT_SURVEY_RESPONSE) {
// TODO: Rework this functionality, as directly calling an analytics refresh here is both inefficient
// and may create duplicate records in the analytics table
const { waitForAnalyticsRebuild } = rest;
if (waitForAnalyticsRebuild) {
const { database } = models;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export class DeleteSurveyResponses extends DeleteHandler {
await super.deleteRecord();

if (this.req.query.waitForAnalyticsRebuild === 'true') {
// TODO: Rework this functionality, as directly calling an analytics refresh here is both inefficient
// and may create duplicate records in the analytics table
const { database } = this.models;
await AnalyticsRefresher.refreshAnalytics(database);
}
Expand Down

0 comments on commit 19dff97

Please sign in to comment.