Skip to content

DCC bug 722 - Fix for dealing with situation where Rest API call - #3159

Merged
briri merged 2 commits into
developmentfrom
dcc_bg_722_fix_for_api_v0_plans_call_timing_out
Apr 19, 2022
Merged

DCC bug 722 - Fix for dealing with situation where Rest API call#3159
briri merged 2 commits into
developmentfrom
dcc_bg_722_fix_for_api_v0_plans_call_timing_out

Conversation

@johnpinto1

Copy link
Copy Markdown
Contributor
      "/api/v0/plans?page=ALL"

was timing out because the processing was taking too long.

Fix for bug https://github.com/DigitalCurationCentre/DMPonline-Service/issues/722

The following change seems to make a difference:

  • in /api/v0/plans_controller.rb the index() method
    replaced includes() with preload():
    @plans = org_admin_plans.includes([{ roles: :user }, { answers: :question_options },
    template: [{ phases: {
    sections: { questions: %i[question_format themes] }
    } }, :org]])
          "/api/v0/plans?page=ALL"
was timing out because the processing was taking too long.

Fix for bug https://github.com/DigitalCurationCentre/DMPonline-Service/issues/722

The following change seems to make a difference:
- in /api/v0/plans_controller.rb the index() method
   replaced includes() with preload():
    @plans = org_admin_plans.includes([{ roles: :user }, { answers: :question_options },
                                           template: [{ phases: {
                                             sections: { questions: %i[question_format themes] }
                                           } }, :org]])
@briri
briri merged commit be7a181 into development Apr 19, 2022
@briri
briri deleted the dcc_bg_722_fix_for_api_v0_plans_call_timing_out branch April 19, 2022 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants