diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-29 21:08:47 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-29 21:08:47 +0300 |
commit | 6b9d3a4e8351e662c4586b24bb152de78ae9e3bf (patch) | |
tree | 883e9db60c047c54418fc1d2b1c5517f97e0f185 /lib/gitlab/patch | |
parent | 23288f62da73fb0e30d8e7ce306665e8fda1b932 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/patch')
-rw-r--r-- | lib/gitlab/patch/active_record_query_cache.rb | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/lib/gitlab/patch/active_record_query_cache.rb b/lib/gitlab/patch/active_record_query_cache.rb deleted file mode 100644 index d6b649cdea7..00000000000 --- a/lib/gitlab/patch/active_record_query_cache.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -# Fixes a bug where the query cache isn't aware of the shared -# ActiveRecord connection used in tests -# https://github.com/rails/rails/issues/36587 - -# To be removed with https://gitlab.com/gitlab-org/gitlab-foss/issues/64413 - -module Gitlab - module Patch - module ActiveRecordQueryCache - # rubocop:disable Gitlab/ModuleWithInstanceVariables - def enable_query_cache! - @query_cache_enabled[connection_cache_key(current_thread)] = true - connection.enable_query_cache! if active_connection? - end - - def disable_query_cache! - @query_cache_enabled.delete connection_cache_key(current_thread) - connection.disable_query_cache! if active_connection? - end - - def query_cache_enabled - @query_cache_enabled[connection_cache_key(current_thread)] - end - - def active_connection? - @thread_cached_conns[connection_cache_key(current_thread)] - end - - private - - def current_thread - @lock_thread || Thread.current - end - # rubocop:enable Gitlab/ModuleWithInstanceVariables - end - end -end |