Skip to content

Commit

Permalink
Revert "Serialize job args when Que.mode = :sync"
Browse files Browse the repository at this point in the history
This reverts commit 461e8b3, while we
figure out the best approach.

Tracking in #5
  • Loading branch information
lawrencejones committed May 3, 2017
1 parent c655cdb commit 8c39b92
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
4 changes: 0 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
### 0.11.7 (2017-05-01)

* Serialize and de-serialize job args when Que.mode = :sync (lawrencejones)

### 0.11.6 (2016-07-01)

* Fix for operating in nested transactions in Rails 5.0. (#160) (greysteil)
Expand Down
2 changes: 1 addition & 1 deletion lib/que/job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def enqueue(*args)
end

if Que.mode == :sync && !t
run(*JSON.parse(attrs[:args].to_json))
run(*attrs[:args])
else
values = Que.execute(:insert_job, attrs.values_at(:queue, :priority, :run_at, :job_class, :retryable, :args)).first
Que.adapter.wake_worker_after_commit unless t
Expand Down
2 changes: 1 addition & 1 deletion lib/que/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Que
Version = '0.11.7'
Version = '0.11.6'
end
4 changes: 2 additions & 2 deletions spec/unit/pool_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
Que.mode = :sync

ArgsJob.enqueue(5, :testing => "synchronous").should be_an_instance_of ArgsJob
$passed_args.should == [5, {"testing" => "synchronous"}]
$passed_args.should == [5, {:testing => "synchronous"}]
DB[:que_jobs].count.should be 0
end

Expand All @@ -68,7 +68,7 @@
Que.mode = :sync

ArgsJob.enqueue(5, :testing => "synchronous").should be_an_instance_of ArgsJob
$passed_args.should == [5, {"testing" => "synchronous"}]
$passed_args.should == [5, {:testing => "synchronous"}]
end

it "should not affect jobs that are queued with specific run_ats" do
Expand Down

0 comments on commit 8c39b92

Please sign in to comment.