sidekiq_bulk_job 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: abdb3b4dcd5011dee64cbedd57c0756aa2fe76750624bb5f541f0401d0d5a017
4
- data.tar.gz: 60303116132214138fca45ef42f6a68e9fd8508967f833abd350afe745a6e738
3
+ metadata.gz: 1acd50d98090657e0c060fd63d2d1733214b964447a233b7a2a4a83b65e54db2
4
+ data.tar.gz: be8c7002b9200fcf374067ff49aa0208866ba50f218beedc91b021c42ecfa2b4
5
5
  SHA512:
6
- metadata.gz: f48334d86d62c8bfcd04ab0a48e8c8c676d02333dcbbed4082d63939159c69f383ac05586c4ccbd373c66111df0bfb57c768acddc28529485c7a277da8ba7740
7
- data.tar.gz: 93b313e2378bd16b47005aafec4b5e47a706715e940b094b9fd779daaa187a04cabfca70771e629ba42a5e9276dc39f3e63628afd674e70d38820da02da46c2f
6
+ metadata.gz: e9b0fee851c8445ef0bc811a16f95716b5c772d3542b83be95c24c60246c0ea91cae491f1b428f8681cfba9bf3464c032779af4cc14664a550ace37fec1d3bff
7
+ data.tar.gz: bcf7ceea6a57f54c414c4a1194b5feb5880aaa3fabbe48f72d95016b3bdce059652cb21ed1e511363d56d17519e78bc0075be9d06b0e143d4709fab4f050f811
@@ -14,7 +14,7 @@ module SidekiqBulkJob
14
14
  end
15
15
 
16
16
  def push(options={})
17
- opts = default_setting.merge(options)
17
+ opts = job_options(options)
18
18
  queue_as = queue(@klass) || :default
19
19
  begin
20
20
  @handler.local(SidekiqBulkJob::BulkJob, opts, queue_as) do
@@ -26,9 +26,14 @@ module SidekiqBulkJob
26
26
 
27
27
  protected
28
28
 
29
- def default_setting
29
+ def job_options(options={})
30
30
  # 0 retry: no retry and dead queue
31
- { 'class' => @klass.to_s, 'args' => @args, 'retry' => 0 }
31
+ opts = { 'class' => @klass.to_s, 'args' => @args, 'retry' => 0 }.merge(options)
32
+ if Sidekiq::VERSION >= "6.0.2"
33
+ Sidekiq.dump_json(opts)
34
+ else
35
+ opts
36
+ end
32
37
  end
33
38
 
34
39
  def queue(woker)
@@ -1,3 +1,3 @@
1
1
  module SidekiqBulkJob
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq_bulk_job
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - scalaview