Skip to content

Commit

Permalink
Errors resistance
Browse files Browse the repository at this point in the history
  • Loading branch information
yosiat committed Jun 16, 2018
1 parent b3d21d6 commit d5581bd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
8 changes: 7 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@ def run_benchmarks(files, items_count: 7_000)

lines = run_process "ITEMS_COUNT=#{items_count} RAILS_ENV=production ruby #{benchmark_file}"
rows = lines.map do |line|
row = JSON.parse(line)
begin
row = JSON.parse(line)
rescue JSON::ParserError
puts "> Failed parsing json"
puts lines.join
exit
end
row.values
end

Expand Down
1 change: 0 additions & 1 deletion benchmarks/type_casts/bm_active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ def db_ar_time
ar_type_convert ActiveRecord::Type::Text, 1, "1"
ar_type_convert ActiveRecord::Type::Integer, "1", 1
ar_type_convert ActiveRecord::Type::Float, "1.23", 1.23
ar_type_convert ActiveRecord::Type::Float, "Infinity", 0.0
ar_type_convert ActiveRecord::Type::Boolean, "true", true
ar_type_convert ActiveRecord::Type::Boolean, "t", true

Expand Down
1 change: 0 additions & 1 deletion benchmarks/type_casts/bm_panko.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ def db_panko_time
panko_type_convert ActiveRecord::Type::Text, 1, "1"
panko_type_convert ActiveRecord::Type::Integer, "1", 1
panko_type_convert ActiveRecord::Type::Float, "1.23", 1.23
panko_type_convert ActiveRecord::Type::Float, "Infinity", ::Float::INFINITY
panko_type_convert ActiveRecord::Type::Boolean, "true", true
panko_type_convert ActiveRecord::Type::Boolean, "t", true

Expand Down

0 comments on commit d5581bd

Please sign in to comment.