tanga_que_extensions 0.0.20 → 0.0.21
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/lib/record_job_status.rb +18 -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: d3904264261280fda0d1d7ce6416adcfc2caa065
|
4
|
+
data.tar.gz: 0d685dcd94fe5f2949a7ef7d13f3bfc2460a0661
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 520aaaba2a036bb83ef04b1a325a493072953ef56761c4b67ce1753a35071f09926057b3d76a3cf6c0da408bde00b5307fa889378e78840b8f9991f04466c191
|
7
|
+
data.tar.gz: 870f9916cf591e5bc33e2d0e054b7c9637bd51a5977dd3b8ce9cef89d45465bc85528443ad73d1a10d7c930d070246ec6d660d9aed4ed09f9c98afc2b598bded
|
data/lib/record_job_status.rb
CHANGED
@@ -3,6 +3,12 @@ module Que::RecordJobStatus
|
|
3
3
|
@job_id || 0
|
4
4
|
end
|
5
5
|
|
6
|
+
def parent_job_id
|
7
|
+
@attrs['args'].first['parent_job_id'] || nil
|
8
|
+
rescue
|
9
|
+
nil
|
10
|
+
end
|
11
|
+
|
6
12
|
def run(args={})
|
7
13
|
@job_id = self.attrs['job_id']
|
8
14
|
record_job_started
|
@@ -24,7 +30,18 @@ module Que::RecordJobStatus
|
|
24
30
|
|
25
31
|
def record_job_started
|
26
32
|
QueJobStatus.where(job_id: job_id).delete_all
|
27
|
-
|
33
|
+
|
34
|
+
hash = {
|
35
|
+
job_id: job_id,
|
36
|
+
attrs: attrs,
|
37
|
+
status: 'executing'
|
38
|
+
}
|
39
|
+
|
40
|
+
if QueJobStatus.connection.column_exists?(:que_job_status, :parent_job_id)
|
41
|
+
hash[:parent_job_id] = parent_job_id
|
42
|
+
end
|
43
|
+
|
44
|
+
QueJobStatus.create!(hash)
|
28
45
|
end
|
29
46
|
|
30
47
|
def record_job_finished
|