diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-07-04 17:48:45 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-07-04 21:56:41 +0800 |
commit | 216bf78fd154005cbf8ec447bfa23f77f6b26775 (patch) | |
tree | 3f2d89b3934865968f39adacd71e90f1bc0868ba /spec | |
parent | 28553dbc05989b698777ee085aa2a357ffe576d2 (diff) | |
download | gitlab-ce-216bf78fd154005cbf8ec447bfa23f77f6b26775.tar.gz |
Introduce Gitlab::Cache::RequestStoreWrap
So that we cache the result of UserAccess#can_push_or_merge_to_branch?
in RequestStore, avoiding querying ProtectedBranch over and over for
the list of pipelines (i.e. in PipelineSerializer)
I don't think this is ideal because I don't like the idea of
RequestStore in general, but this is the easiest way to cache it
without changing the architecture. In the future we should cache
more explicitly rather than this kind of global store.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/serializers/pipeline_serializer_spec.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/serializers/pipeline_serializer_spec.rb b/spec/serializers/pipeline_serializer_spec.rb index 44813656aff..8dc666586c7 100644 --- a/spec/serializers/pipeline_serializer_spec.rb +++ b/spec/serializers/pipeline_serializer_spec.rb @@ -110,7 +110,7 @@ describe PipelineSerializer do it 'verifies number of queries', :request_store do recorded = ActiveRecord::QueryRecorder.new { subject } - expect(recorded.count).to be_within(1).of(57) + expect(recorded.count).to be_within(1).of(59) expect(recorded.cached_count).to eq(0) end |