From 25ce1f3399881454fd0a9b055f2bebedc0e0ee17 Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Mon, 9 Dec 2024 11:11:03 +0800 Subject: [PATCH] PERF: Don't execute a `git` command each time we log a log line (#30177) We already have a `GIT_VERSION` constant in `DiscourseLogstashLogger` so we can just use that. --- lib/discourse_logstash_logger.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/discourse_logstash_logger.rb b/lib/discourse_logstash_logger.rb index 00881380f65..a88e45e88cf 100644 --- a/lib/discourse_logstash_logger.rb +++ b/lib/discourse_logstash_logger.rb @@ -67,7 +67,7 @@ class DiscourseLogstashLogger < Logger "pid" => PROCESS_PID, "type" => @type.to_s, "host" => HOST, - "git_version" => GitUtils.git_version, + "git_version" => GIT_VERSION, } # Only log backtrace and env for Logger::WARN and above.