funktor 0.4.1 → 0.4.2

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: 0b6528117a7c1bae745c1d00b14a47e557b604b8347e805bc4d376a1f62baab7
4
- data.tar.gz: f351a007712e41b8fc1962cddf5a42f08707e9db76ab651962fe4c7e3631dfa5
3
+ metadata.gz: 57488e1ec71535021b02e646cce074552b08bab597ccf0394df4eaee7b9b8480
4
+ data.tar.gz: 2d38386a8da34bc2737da98dad4336b90820b03d85c18b52ca0d09d0d2d85a63
5
5
  SHA512:
6
- metadata.gz: 8c7a65dac8b17841022f3f3d9b37931f36797fb0bde9c9bcfac8c809cfd2a6c78e301395e4fc8bc34f2f80d7b8b152ab521b34cddb011c6d58c74a48d2c8fa33
7
- data.tar.gz: abcdd24ca17c14e8f30c5ea3966c3dc818e4b3e7af5b162049c787aec72d38b634469bd027dddf8a8f99291082fe371c6679c71711dae6c9b90ea3f4aa0d7470
6
+ metadata.gz: 2ea9cc75cc179ff340d35fa48d5dbbaba7604b30b1361efb0a3ed8783de6b929279c39cd237ca1b78863e0622a9eb2a5c8f23f2b707d40159f09bdf788f97b4c
7
+ data.tar.gz: 8b018ebd3e15892fcf4b13feedb77873f41a59d75a62b6ee498808e9848f0e717785e4347d9f294b737025519f527a792b6b64c8c70334b8023e8733205c5aee
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- funktor (0.4.0)
4
+ funktor (0.4.1)
5
5
  activesupport
6
6
  aws-sdk-sqs (~> 1.37)
7
7
  thor
@@ -16,17 +16,22 @@ module ActiveJob
16
16
  "worker" => JobWrapper.to_s,
17
17
  "wrapped" => job.class,
18
18
  "queue" => job.class.work_queue,
19
+ "delay" => 0,
19
20
  "worker_params" => [ job.serialize ]
20
21
  })
21
22
  end
22
23
 
23
24
  def enqueue_at(job, timestamp) # :nodoc:
25
+ delay = (timestamp.utc - Time.now.utc).round
26
+ if delay < 0
27
+ delay = 0
28
+ end
24
29
  job.provider_job_id = Funktor.job_pusher.push({
25
30
  "worker" => JobWrapper.to_s,
26
31
  "wrapped" => job.class,
27
32
  "queue" => job.class.work_queue,
28
- "worker_params" => [ job.serialize ],
29
- "at" => timestamp
33
+ "delay" => delay,
34
+ "worker_params" => [ job.serialize ]
30
35
  })
31
36
  end
32
37
 
data/lib/funktor/job.rb CHANGED
@@ -38,7 +38,7 @@ module Funktor
38
38
  # TODO - In Funktor Pro we need to override this method (or do something else) so that
39
39
  # we can schedule jobs farther in the future than 15 minutes. We do this here in case a
40
40
  # retry sequence goes too long.
41
- jdelay = job_data["delay"]
41
+ jdelay = job_data["delay"] || 0
42
42
  return jdelay < 900 ? jdelay : 900
43
43
  end
44
44
 
@@ -1,3 +1,3 @@
1
1
  module Funktor
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: funktor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Green