about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/web-apps/discourse/plugins/discourse-prometheus/no-git-version.patch
blob: 9aebfd8aa794336fe0c9c95b9de595973c502025 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
diff --git a/lib/internal_metric/global.rb b/lib/internal_metric/global.rb
index 682571b..7bdd431 100644
--- a/lib/internal_metric/global.rb
+++ b/lib/internal_metric/global.rb
@@ -30,28 +30,7 @@ module DiscoursePrometheus::InternalMetric
       @active_app_reqs = 0
       @queued_app_reqs = 0
       @fault_logged = {}
-
-      begin
-        @@version = nil
-
-        out, error, status = Open3.capture3("git rev-parse HEAD")
-
-        if status.success?
-          @@version ||= out.chomp
-        else
-          raise error
-        end
-      rescue => e
-        if defined?(::Discourse)
-          Discourse.warn_exception(e, message: "Failed to calculate discourse_version_info metric")
-        else
-          STDERR.puts "Failed to calculate discourse_version_info metric: #{e}\n#{e.backtrace.join("\n")}"
-        end
-
-        @@retries ||= 10
-        @@retries -= 1
-        @@version = -1 if @@retries < 0
-      end
+      @@version = -1
     end
 
     def collect