diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/groups/autocomplete_sources_controller.rb | 5 | ||||
-rw-r--r-- | app/controllers/projects/autocomplete_sources_controller.rb | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/app/controllers/groups/autocomplete_sources_controller.rb b/app/controllers/groups/autocomplete_sources_controller.rb index 414461d9e93..86bf65f4723 100644 --- a/app/controllers/groups/autocomplete_sources_controller.rb +++ b/app/controllers/groups/autocomplete_sources_controller.rb @@ -8,6 +8,11 @@ class Groups::AutocompleteSourcesController < Groups::ApplicationController urgency :low, [:issues, :labels, :milestones, :commands, :merge_requests, :members] def members + if Feature.enabled?(:cache_autocomplete_sources_members, current_user) + # Cache the response on the frontend + expires_in 3.minutes + end + render json: ::Groups::ParticipantsService.new(@group, current_user).execute(target) end diff --git a/app/controllers/projects/autocomplete_sources_controller.rb b/app/controllers/projects/autocomplete_sources_controller.rb index 480e3408023..60c8fe97e81 100644 --- a/app/controllers/projects/autocomplete_sources_controller.rb +++ b/app/controllers/projects/autocomplete_sources_controller.rb @@ -13,6 +13,11 @@ class Projects::AutocompleteSourcesController < Projects::ApplicationController urgency :low, [:issues, :labels, :milestones, :commands, :contacts] def members + if Feature.enabled?(:cache_autocomplete_sources_members, current_user) + # Cache the response on the frontend + expires_in 3.minutes + end + render json: ::Projects::ParticipantsService.new(@project, current_user).execute(target) end |