2022-03-30 16:19:32 +08:00
|
|
|
module Trace
|
|
|
|
class << self
|
|
|
|
def trace_config
|
|
|
|
trace_config = {}
|
|
|
|
|
|
|
|
begin
|
|
|
|
config = Rails.application.config_for(:configuration).symbolize_keys!
|
|
|
|
trace_config = config[:trace].symbolize_keys!
|
|
|
|
raise 'trace config missing' if trace_config.blank?
|
2022-04-11 10:50:18 +08:00
|
|
|
rescue => ex
|
2022-03-30 16:19:32 +08:00
|
|
|
raise ex if Rails.env.production?
|
|
|
|
|
|
|
|
puts %Q{\033[33m [warning] gitea config or configuration.yml missing,
|
|
|
|
please add it or execute 'cp config/configuration.yml.example config/configuration.yml' \033[0m}
|
|
|
|
trace_config = {}
|
|
|
|
end
|
|
|
|
|
|
|
|
trace_config
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|