2016-07-15 11:46:39 -04:00
|
|
|
require 'fileutils'
|
|
|
|
|
|
|
|
module Gitlab
|
|
|
|
module RequestProfiler
|
2017-02-21 18:32:18 -05:00
|
|
|
PROFILES_DIR = "#{Gitlab.config.shared.path}/tmp/requests_profiles".freeze
|
2016-07-15 11:46:39 -04:00
|
|
|
|
|
|
|
def profile_token
|
|
|
|
Rails.cache.fetch('profile-token') do
|
|
|
|
Devise.friendly_token
|
|
|
|
end
|
|
|
|
end
|
|
|
|
module_function :profile_token
|
|
|
|
|
|
|
|
def remove_all_profiles
|
|
|
|
FileUtils.rm_rf(PROFILES_DIR)
|
|
|
|
end
|
|
|
|
module_function :remove_all_profiles
|
|
|
|
end
|
|
|
|
end
|