From 989280a2228e75a801425ee294dc8e1b1f29ced0 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Fri, 20 Oct 2017 12:41:40 +0800 Subject: [PATCH] FIX: Don't rotate session in reaodnly mode. --- app/controllers/application_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index cce9eb95fd9..aad7b9a4e91 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -66,7 +66,7 @@ class ApplicationController < ActionController::Base end def perform_refresh_session - refresh_session(current_user) + refresh_session(current_user) unless @readonly_mode end def immutable_for(duration) @@ -108,6 +108,7 @@ class ApplicationController < ActionController::Base rescue_from PG::ReadOnlySqlTransaction do |e| Discourse.received_readonly! + Rails.logger.error("#{e.class} #{e.message}: #{e.backtrace.join("\n")}") raise Discourse::ReadOnly end