Skip to content

Commit

Permalink
[CPDLP-1913] Restrict participants endpoint fields
Browse files Browse the repository at this point in the history
This endpoint is currently timing out in production for certain
providers. One possible way to speed it up is by reducing the amount of
columns returned to only the necessary ones.
  • Loading branch information
tvararu authored and cwrw committed Jan 22, 2023
1 parent 8eaba67 commit 83347f3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/services/api/v1/ecf/participants_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,19 @@ def induction_records
},
)

necessary_fields = %i[
induction_programme_id
induction_status
mentor_profile_id
participant_profile_id
preferred_identity_id
schedule_id
training_status
updated_at
]

scope = InductionRecord
.select(*necessary_fields)
.references(participant_profile: %i[participant_identity])
.includes(
:preferred_identity,
Expand Down

0 comments on commit 83347f3

Please sign in to comment.