summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorThong Kuah <tkuah@gitlab.com>2019-04-04 22:18:37 +1300
committerThong Kuah <tkuah@gitlab.com>2019-04-04 22:18:37 +1300
commit480d57d2f72eb2b1ce2e5a45ac2989ead031775a (patch)
treeaa275232ec02a8e76033ba68e7873afc34f5dbc6 /app
parentd0a0d3d3d5043d1497a5cd42e6c6bc073f6a5b58 (diff)
downloadgitlab-ce-480d57d2f72eb2b1ce2e5a45ac2989ead031775a.tar.gz
Do not inherit when calling const_get
Otherwise we will get really confusing behavior in development environment (where eager_load is false) where it attempts to load `Prometheus::Queries::EnvironmentQuery` when query_class_name is `Gitlab::Prometheus::Queries::EnvironmentQuery`, the `Prometheus` module is loaded from a gem but not anything in `Gitlab::Prometheus`.
Diffstat (limited to 'app')
-rw-r--r--app/models/concerns/prometheus_adapter.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/concerns/prometheus_adapter.rb b/app/models/concerns/prometheus_adapter.rb
index a29e80fe0c1..ae6cf88231b 100644
--- a/app/models/concerns/prometheus_adapter.rb
+++ b/app/models/concerns/prometheus_adapter.rb
@@ -36,7 +36,7 @@ module PrometheusAdapter
def calculate_reactive_cache(query_class_name, *args)
return unless prometheus_client
- data = Kernel.const_get(query_class_name).new(prometheus_client_wrapper).query(*args)
+ data = Kernel.const_get(query_class_name, false).new(prometheus_client_wrapper).query(*args)
{
success: true,
data: data,