tanga_que_extensions 0.0.19 → 0.0.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/child_job.rb +9 -7
- data/test/test_child_jobs.rb +1 -2
- 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: 8c0d30edef8adc8a9d3fc5e14d20fec662a7aa55
|
4
|
+
data.tar.gz: 31b9a43eb752f4824a1feda364bbcf42f1097bf2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1dcb704a5566e1078883d9b05b37e6c63e9b5a08a446ee0b3f0109b01d4fab4378825dd74c3f8ff915e6ca5dd52722d3a4accd59eab33f0afd14d1958307a0bf
|
7
|
+
data.tar.gz: 6f2386902018a1a1d2a5097e3f4a997aca07417f03abdc5b50bee664da9f236b18d4d6c7059ced59bf0b45243dea5b7fbb5adadbc1eab54b595fd00c1fb1a478
|
data/lib/child_job.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
|
-
module Que
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
module Que
|
2
|
+
class ChildJob < Que::Job
|
3
|
+
def self.enqueue(*args)
|
4
|
+
Que.transaction do
|
5
|
+
job_data = super
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
7
|
+
parent_job_id = args.first[:parent_job_id] rescue nil
|
8
|
+
if parent_job_id.present?
|
9
|
+
QueJob.where(job_id: job_data.attrs['job_id']).update_all(parent_job_id: parent_job_id)
|
10
|
+
end
|
9
11
|
end
|
10
12
|
end
|
11
13
|
end
|
data/test/test_child_jobs.rb
CHANGED