From 82bdbbcb5f1c8a1be45709d4e85d0d35ed071bbf Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 3 Feb 2021 10:12:05 -0500 Subject: [PATCH] added elastic apm and fixed session updated_at bug --- app/controllers/concerns/session_tracking_concern.rb | 2 +- config/elastic_apm.yml | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 config/elastic_apm.yml diff --git a/app/controllers/concerns/session_tracking_concern.rb b/app/controllers/concerns/session_tracking_concern.rb index 8a113844..26e2a9c8 100644 --- a/app/controllers/concerns/session_tracking_concern.rb +++ b/app/controllers/concerns/session_tracking_concern.rb @@ -19,6 +19,6 @@ module SessionTrackingConcern end def session_needs_update? - !current_session.nil? && current_session.updated_at < UPDATE_SIGN_IN_HOURS.hours.ago + !current_session.nil? && current_session.updated_at > UPDATE_SIGN_IN_HOURS.hours.ago end end diff --git a/config/elastic_apm.yml b/config/elastic_apm.yml new file mode 100644 index 00000000..4106db3f --- /dev/null +++ b/config/elastic_apm.yml @@ -0,0 +1,11 @@ +# config/elastic_apm.yml: + +# Set service name - allowed characters: a-z, A-Z, 0-9, -, _ and space +# Defaults to the name of your Rails app +service_name: <%= ENV['ELASTIC_APM_URL'] || 'gabsocial' %> + +# Use if APM Server requires a token +secret_token: <%= ENV['ELASTIC_APM_SECRET_TOKEN'] || '' %> + +# Set custom APM Server URL (default: http://localhost:8200) +server_url: <%= ENV['ELASTIC_APM_URL'] || 'http://localhost:8200'%>