Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 1 addition & 8 deletions lib/que.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# frozen_string_literal: true

require "json"
require "socket" # For hostname

require_relative "que/adapters/base"
Expand All @@ -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|
Expand Down
4 changes: 2 additions & 2 deletions lib/que/adapters/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading