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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/active_job/queue_adapters/funktor_adapter.rb +10 -3
- data/lib/funktor/job.rb +1 -1
- data/lib/funktor/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b3b433385515fb0c83b00d224c60fbafec19e0e13ea3b977f54e47aa272195c
|
4
|
+
data.tar.gz: a487206b8c0a770a0b1be992589e1833510d5f3dd9816d0a3fd4ab91e7d798ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3a24838a4d2f01fc165b9cc7837a1478051a94c90c24a9faae05bf181d6b26a10c0d1919441863a26f99dc9bc5b08e89c33f9c4b95bd386fcea5cd55e7881ac
|
7
|
+
data.tar.gz: aba635dc283b1957f96d24e004fe80acaa2d0eba24ac7b3bcab1e654ba19224698c85a5481b49903a2f52606fa60dcafff0e41eed737ce4e53c98ddc83b1a92c
|
data/Gemfile.lock
CHANGED
@@ -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
|
-
"
|
29
|
-
"
|
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
|
-
|
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
|
|
data/lib/funktor/version.rb
CHANGED