sqewer 6.0.5 → 6.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/sqewer/extensions/active_job_adapter.rb +18 -2
- data/lib/sqewer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a2ea4f82f0df911ffb45032ec714b8d2545780a
|
4
|
+
data.tar.gz: 3bde7fb9fb85a51a80ab566768a3eafd23c2825d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 592ba8e297da9d9e7a07a35cbb0521cd6f932e376709933560eec4ea609482f0ca00956612ab839ca4df83e2bec7dd35fb3612c856fb2ee0fc1c0e0d92ba9a9d
|
7
|
+
data.tar.gz: 56005129f98d24234235de265cf1216433392276018011276f4872fa742ab80b5c62aea82b227881a4aca7e65fe56d24f2e424fa1afea64e040c7c79948b2854
|
data/CHANGELOG.md
CHANGED
@@ -69,19 +69,35 @@ module ActiveJob
|
|
69
69
|
|
70
70
|
end
|
71
71
|
|
72
|
-
def enqueue(active_job) #:nodoc:
|
72
|
+
def self.enqueue(active_job) #:nodoc:
|
73
73
|
wrapped_job = Performable.from_active_job(active_job)
|
74
74
|
|
75
75
|
Sqewer.submit!(wrapped_job)
|
76
76
|
end
|
77
77
|
|
78
|
-
def enqueue_at(active_job, timestamp) #:nodoc:
|
78
|
+
def self.enqueue_at(active_job, timestamp) #:nodoc:
|
79
79
|
wrapped_job = Performable.from_active_job(active_job)
|
80
80
|
|
81
81
|
delta_t = (timestamp - Time.now.to_i).to_i
|
82
82
|
|
83
83
|
Sqewer.submit!(wrapped_job, delay_seconds: delta_t)
|
84
84
|
end
|
85
|
+
|
86
|
+
# ActiveJob in Rails 4 resolves the symbol value you give it
|
87
|
+
# and then tries to call enqueue_* methods directly on what
|
88
|
+
# got resolved. In Rails 5, first Rails will call .new on
|
89
|
+
# what it resolved from the symbol and _then_ call enqueue
|
90
|
+
# and enqueue_at on that what has gotten resolved. This means
|
91
|
+
# that we have to expose these methods _both_ as class methods
|
92
|
+
# and as instance methods.
|
93
|
+
# This can be removed when we stop supporting Rails 4.
|
94
|
+
def enqueue_at(*args)
|
95
|
+
self.class.enqueue_at(*args)
|
96
|
+
end
|
97
|
+
|
98
|
+
def enqueue(*args)
|
99
|
+
self.class.enqueue(*args)
|
100
|
+
end
|
85
101
|
end
|
86
102
|
end
|
87
103
|
end
|
data/lib/sqewer/version.rb
CHANGED