funktor 0.4.1 → 0.4.5

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: 1b3b433385515fb0c83b00d224c60fbafec19e0e13ea3b977f54e47aa272195c
4
+ data.tar.gz: a487206b8c0a770a0b1be992589e1833510d5f3dd9816d0a3fd4ab91e7d798ab
5
5
  SHA512:
6
- metadata.gz: 8c7a65dac8b17841022f3f3d9b37931f36797fb0bde9c9bcfac8c809cfd2a6c78e301395e4fc8bc34f2f80d7b8b152ab521b34cddb011c6d58c74a48d2c8fa33
7
- data.tar.gz: abcdd24ca17c14e8f30c5ea3966c3dc818e4b3e7af5b162049c787aec72d38b634469bd027dddf8a8f99291082fe371c6679c71711dae6c9b90ea3f4aa0d7470
6
+ metadata.gz: f3a24838a4d2f01fc165b9cc7837a1478051a94c90c24a9faae05bf181d6b26a10c0d1919441863a26f99dc9bc5b08e89c33f9c4b95bd386fcea5cd55e7881ac
7
+ data.tar.gz: aba635dc283b1957f96d24e004fe80acaa2d0eba24ac7b3bcab1e654ba19224698c85a5481b49903a2f52606fa60dcafff0e41eed737ce4e53c98ddc83b1a92c
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.5)
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 = (Time.at(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
 
@@ -34,7 +39,9 @@ module ActiveJob
34
39
  include Funktor::Worker
35
40
 
36
41
  def perform(job_data)
37
- Base.execute job_data.first
42
+ puts "job_data = #{job_data.class} #{job_data}"
43
+ puts job_data
44
+ Base.execute *job_data
38
45
  end
39
46
  end
40
47
  end
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.5"
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.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Green