Commit 480d57d2 authored by Thong Kuah's avatar Thong Kuah

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`.
parent d0a0d3d3
...@@ -36,7 +36,7 @@ module PrometheusAdapter ...@@ -36,7 +36,7 @@ module PrometheusAdapter
def calculate_reactive_cache(query_class_name, *args) def calculate_reactive_cache(query_class_name, *args)
return unless prometheus_client 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, success: true,
data: data, data: data,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment