Skip to content
Snippets Groups Projects
Verified Commit a7be3dfa authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Remove set of thread variables

parent 772f2f1a
No related branches found
No related tags found
No related merge requests found
Loading
@@ -4,7 +4,6 @@ class ApplicationController < ActionController::Base
Loading
@@ -4,7 +4,6 @@ class ApplicationController < ActionController::Base
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :reject_blocked! before_filter :reject_blocked!
before_filter :check_password_expiration before_filter :check_password_expiration
around_filter :set_current_user_for_thread
before_filter :add_abilities before_filter :add_abilities
before_filter :ldap_security_check before_filter :ldap_security_check
before_filter :dev_tools if Rails.env == 'development' before_filter :dev_tools if Rails.env == 'development'
Loading
@@ -53,15 +52,6 @@ class ApplicationController < ActionController::Base
Loading
@@ -53,15 +52,6 @@ class ApplicationController < ActionController::Base
end end
end end
   
def set_current_user_for_thread
Thread.current[:current_user] = current_user
begin
yield
ensure
Thread.current[:current_user] = nil
end
end
def abilities def abilities
@abilities ||= Six.new @abilities ||= Six.new
end end
Loading
Loading
Loading
@@ -10,12 +10,4 @@ class BaseObserver < ActiveRecord::Observer
Loading
@@ -10,12 +10,4 @@ class BaseObserver < ActiveRecord::Observer
def log_info message def log_info message
Gitlab::AppLogger.info message Gitlab::AppLogger.info message
end end
def current_user
Thread.current[:current_user]
end
def current_commit
Thread.current[:current_commit]
end
end end
Loading
@@ -36,16 +36,6 @@ module API
Loading
@@ -36,16 +36,6 @@ module API
end end
end end
   
def set_current_user_for_thread
Thread.current[:current_user] = current_user
begin
yield
ensure
Thread.current[:current_user] = nil
end
end
def user_project def user_project
@project ||= find_project(params[:id]) @project ||= find_project(params[:id])
@project || not_found! @project || not_found!
Loading
Loading
Loading
@@ -9,12 +9,7 @@ module Gitlab
Loading
@@ -9,12 +9,7 @@ module Gitlab
end end
   
def self.by_user(user) def self.by_user(user)
begin yield
Thread.current[:current_user] = user
yield
ensure
Thread.current[:current_user] = nil
end
end end
   
def self.mute_mailer def self.mute_mailer
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment