FIX: Don't log request when Discourse is in readonly due to PG.

FIX: Don’t log request when Discourse is in readonly due to PG.

diff --git a/lib/middleware/request_tracker.rb b/lib/middleware/request_tracker.rb
index 71a1c67..1c2fec8 100644
--- a/lib/middleware/request_tracker.rb
+++ b/lib/middleware/request_tracker.rb
@@ -72,7 +72,9 @@ class Middleware::RequestTracker
 
   def self.log_request_on_site(data, host)
     RailsMultisite::ConnectionManagement.with_hostname(host) do
-      log_request(data)
+      unless Discourse.readonly_mode?([Discourse::PG_READONLY_MODE_KEY])
+        log_request(data)
+      end
     end
   end

GitHub sha: e2a20d90