Skip to content

Commit 69980b3

Browse files
committed
Source maps
1 parent b76f501 commit 69980b3

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

app/models/sponsor.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,20 @@ def ads_for(ip)
99
params.merge!( testMode: true, ignore: true ) if Rails.env.development?
1010
uri = URI::HTTPS.build(host: HOST, path: PATH, query: params.to_query)
1111

12+
error = nil
1213
results = begin
1314
start = Time.now
1415
response = Faraday.new(url: uri).get do |req|
1516
req.options.timeout = 2 # open/read timeout in seconds
1617
req.options.open_timeout = 1 # connection open timeout in seconds
1718
end
18-
Rails.logger.info "sponsor=success seconds=#{"%.2f" % (Time.now - start)}"
1919

2020
JSON.parse(response.body) rescue nil
2121
rescue Faraday::TimeoutError, Net::OpenTimeout => e
22-
Rails.logger.info "sponsor=timeout seconds=#{"%.2f" % (Time.now - start)} type=#{e}"
22+
error = e
2323
nil
2424
end
25+
Rails.logger.info "sponsor=#{error ? 'fail' : 'ok'} seconds=#{"%.2f" % (Time.now - start)} error=#{error}"
2526

2627
return [] if results.nil?
2728
results['ads'].select{|a| a['creativeid'] }.collect{ |data| build_sponsor(data) }

client/webpack.client.rails.build.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ if (devBuild) {
5454
config.devtool = 'eval-source-map'
5555
} else {
5656
console.error('Webpack production build for Rails') // eslint-disable-line no-console
57+
config.devtool = 'source-map'
5758
}
5859

5960
module.exports = config

0 commit comments

Comments
 (0)