diff --git a/app/models/employee.rb b/app/models/employee.rb index f27adf29..1af33498 100755 --- a/app/models/employee.rb +++ b/app/models/employee.rb @@ -41,14 +41,15 @@ class Employee < ApplicationRecord if (session_token) user = Employee.find_by_token_session(session_token) expiry_time = login_expiry_time - - if user && user.session_expiry.utc > DateTime.now.utc - #Extend the login time each time authenticatation take place - user.session_expiry = user.session_expiry.utc + expiry_time.minutes - user.save - return true - else - return false + if !user.session_expiry.nil? + if user && user.session_expiry.utc > DateTime.now.utc + #Extend the login time each time authenticatation take place + user.session_expiry = user.session_expiry.utc + expiry_time.minutes + user.save + return true + else + return false + end end end diff --git a/config/puma.rb b/config/puma.rb index d24425ae..f0013d25 100755 --- a/config/puma.rb +++ b/config/puma.rb @@ -1,11 +1,11 @@ -application_path="#{File.expand_path("../..", __FILE__)}" -directory application_path -#environment ENV.fetch("RAILS_ENV") { "production" } -environment "production" -pidfile "#{application_path}/tmp/puma/pid" -state_path "#{application_path}/tmp/puma/state" -stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log" -port ENV.fetch("PORT") { 62158 } -workers 2 -preload_app! -threads 1,1 +# application_path="#{File.expand_path("../..", __FILE__)}" +# directory application_path +# #environment ENV.fetch("RAILS_ENV") { "production" } +# environment "production" +# pidfile "#{application_path}/tmp/puma/pid" +# state_path "#{application_path}/tmp/puma/state" +# stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log" +# port ENV.fetch("PORT") { 62158 } +# workers 2 +# preload_app! +# threads 1,1