coney_island 0.17.3 → 0.17.4

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: 2b99590e8d056cb729437dac5eeee4ff1a9b8b42de94e62eb10feed1ab9b23e1
4
- data.tar.gz: ec312b8cc27b6ced4c9db6a65d1ec27bdca117313a4076a3f85dc6794b2d52b1
3
+ metadata.gz: ba75ef6cdbabd5978440f368c350f13b90c78320e560ca01983bd8c2fde11b12
4
+ data.tar.gz: bfee194d127676dbcc487a0d52b2fa99910033e2bb0e8e12618be6d89bd941eb
5
5
  SHA512:
6
- metadata.gz: 1e243751621c7125aef801154ff3a67171be8154f8d358e6e797060d570348947d3e218ba61562278db1b99f7b4d473ac4bc3edae932782bb7f1b4f220d42922
7
- data.tar.gz: 5ebbc494b7e151120a060dd69d74297101283b50b0684c4905759b6089bb5f919d381de927bbc65b96178d2b7fb219c92699688d1b830488504c02f125d02eb2
6
+ metadata.gz: f3f656c12ac0ec8b77ca055ca47825ab7e9d8c51f83da368426aeda7b434b341d59133c0e09d9248586e68d885492b80300af477f275bfd5c2d8fabc4d0c5141
7
+ data.tar.gz: 864403d7f743b07b31b4ed930156324e4e4b59c32e7bc97b73e920c0ca099778bf970e6adb94e3347d098814f0c529890ba7ce057847e57ec919d0d05747728e
@@ -10,12 +10,18 @@ module ActiveJob
10
10
  #
11
11
  # Rails.application.config.active_job.queue_adapter = :coney_island
12
12
  def enqueue(job) #:nodoc:
13
- ConeyIsland::Submitter.submit JobWrapper, :perform, args: [job.serialize], work_queue: job.queue_name, timeout: get_timeout_from_args(job), retry_limit: get_retry_from_args(job)
13
+ ConeyIsland::Submitter.submit job.class, :perform, args: job.arguments, work_queue: job.queue_name, timeout: get_timeout_from_args(job),
14
+ retry_limit: get_retry_from_args(job), singleton: true
14
15
  end
15
16
 
16
17
  def enqueue_at(job, timestamp) #:nodoc:
18
+ params = {args: job.arguments, work_queue: job.queue_name, timeout: get_timeout_from_args(job),
19
+ retry_limit: get_retry_from_args(job), singleton: true}
17
20
  delay = timestamp - Time.current.to_f
18
- ConeyIsland::Submitter.submit JobWrapper, :perform, args: [job.serialize], work_queue: job.queue_name, delay: delay, timeout: get_timeout_from_args(job), retry_limit: get_retry_from_args(job)
21
+ if delay > 0
22
+ params[:delay] = delay.round
23
+ end
24
+ ConeyIsland::Submitter.submit job.class, :perform, params
19
25
  end
20
26
 
21
27
  def get_timeout_from_args(job)
@@ -26,13 +32,6 @@ module ActiveJob
26
32
  job.class::RETRY_LIMIT if job.class.const_defined? :RETRY_LIMIT
27
33
  end
28
34
 
29
- class JobWrapper #:nodoc:
30
- class << self
31
- def perform(job_data)
32
- Base.execute job_data.stringify_keys!
33
- end
34
- end
35
- end
36
35
  end
37
36
  end
38
37
  end
@@ -147,7 +147,6 @@ module ConeyIsland
147
147
  @connection
148
148
  end
149
149
 
150
- # TODO: Document me
151
150
  def self.publish_job(args, job_id = nil)
152
151
  # Map arguments
153
152
  klass, method_name, job_args = *args
@@ -1,3 +1,3 @@
1
1
  module ConeyIsland
2
- VERSION = "0.17.3"
2
+ VERSION = "0.17.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coney_island
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.3
4
+ version: 0.17.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Draut
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-10-14 00:00:00.000000000 Z
13
+ date: 2018-10-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails