Project

General

Profile

« Previous | Next » 

Revision d9a2ebac

Added by Ohad Levy almost 12 years ago

  • ID d9a2ebac6e9ec0082e60265b794f54a29a1f7e65

[SQL optimizations] - many small optimizations

This is one of a few patches aim to improve Foreman performance
  • Bookmarks have only users, not usergroups
  • added caching to the settings table
  • removed notice message lookups (we are not really using those)
  • added caching to top bar (tabs + bookmarks) and expiry.
  • removed non needed JS to load

View differences:

app/controllers/application_controller.rb
before_filter :require_ssl, :require_login
before_filter :session_expiry, :update_activity_time, :unless => proc {|c| c.remote_user_provided? || c.api_request? } if SETTINGS[:login]
before_filter :welcome, :detect_notices, :only => :index, :unless => :api_request?
before_filter :welcome, :only => :index, :unless => :api_request?
before_filter :authorize
cache_sweeper :topbar_sweeper
def welcome
@searchbar = true
klass = controller_name == "dashboard" ? "Host" : controller_name.camelize.singularize
......
end
def update_activity_time
session[:expires_at] = Setting.idle_timeout.minutes.from_now.utc
session[:expires_at] = Setting[:idle_timeout].minutes.from_now.utc
end
def expire_session
......
logger.debug exception.backtrace.join("\n")
render :template => "common/500", :layout => !request.xhr?, :status => 500, :locals => { :exception => exception}
end
end

Also available in: Unified diff