diff --git a/CHANGELOG.md b/CHANGELOG.md index df72292f..d9a8d6c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ * Introduction of Kubernetes benchmark code * Performance patch to Que locking +### 0.13.0 (2017-06-08) + +* Fix recurring JSON issues by dropping MultiJson support. + ### 0.11.8 (2017-07-12) * Serialise and deserialise job args when running in sync mode. (georgea93) diff --git a/Gemfile b/Gemfile index 089ab9f0..d031a83e 100644 --- a/Gemfile +++ b/Gemfile @@ -10,7 +10,6 @@ group :development, :test do gem 'activerecord', require: nil gem 'connection_pool', require: nil gem 'gc_ruboconfig' - gem 'multi_json', '~> 1.21', require: nil gem 'pg', require: nil, platform: :ruby gem 'pg_jruby', require: nil, platform: :jruby gem 'pond', require: nil diff --git a/lib/que.rb b/lib/que.rb index 7c1bee80..439162bc 100644 --- a/lib/que.rb +++ b/lib/que.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require "json" require "socket" # For hostname require_relative "que/adapters/base" @@ -17,14 +18,6 @@ require_relative "que/middleware/worker_health_check" module Que - begin - require "multi_json" - JSON_MODULE = MultiJson - rescue LoadError - require "json" - JSON_MODULE = JSON - end - HASH_DEFAULT_PROC = proc { |hash, key| hash[key.to_s] if key.is_a?(Symbol) } INDIFFERENTIATOR = proc do |object| diff --git a/lib/que/adapters/base.rb b/lib/que/adapters/base.rb index b6a6555b..570218fc 100644 --- a/lib/que/adapters/base.rb +++ b/lib/que/adapters/base.rb @@ -31,7 +31,7 @@ class Base # integer 23 => proc(&:to_i), # json - 114 => ->(value) { JSON_MODULE.parse(value, create_additions: false) }, + 114 => ->(value) { JSON.parse(value, create_additions: false) }, # float 701 => proc(&:to_f), # timestamp with time zone @@ -74,7 +74,7 @@ def execute(command, params = []) # The pg gem unfortunately doesn't convert fractions of time instances, so cast # them to a string. when Time then param.strftime("%Y-%m-%d %H:%M:%S.%6N %z") - when Array, Hash then JSON_MODULE.generate(param) + when Array, Hash then JSON.generate(param) else param end end