From 8b701c11e3b7916e9b35aadf390466c253ac9e12 Mon Sep 17 00:00:00 2001 From: Fosco Marotto Date: Sat, 30 Jan 2021 01:38:43 -0500 Subject: [PATCH] Re-enable session activity update --- app/controllers/concerns/session_tracking_concern.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/concerns/session_tracking_concern.rb b/app/controllers/concerns/session_tracking_concern.rb index 49fb6b1e..8a113844 100644 --- a/app/controllers/concerns/session_tracking_concern.rb +++ b/app/controllers/concerns/session_tracking_concern.rb @@ -13,11 +13,12 @@ module SessionTrackingConcern def set_session_activity return unless session_needs_update? - current_session.touch + conn = ActiveRecord::Base.connection + conn.stick_to_master! + conn.exec_query "update session_activations set updated_at = NOW() where id = #{current_session.id}" end def session_needs_update? - # !current_session.nil? && current_session.updated_at < UPDATE_SIGN_IN_HOURS.hours.ago - false + !current_session.nil? && current_session.updated_at < UPDATE_SIGN_IN_HOURS.hours.ago end end