tanga_que_extensions 0.0.20 → 0.0.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/record_job_status.rb +18 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8c0d30edef8adc8a9d3fc5e14d20fec662a7aa55
4
- data.tar.gz: 31b9a43eb752f4824a1feda364bbcf42f1097bf2
3
+ metadata.gz: d3904264261280fda0d1d7ce6416adcfc2caa065
4
+ data.tar.gz: 0d685dcd94fe5f2949a7ef7d13f3bfc2460a0661
5
5
  SHA512:
6
- metadata.gz: 1dcb704a5566e1078883d9b05b37e6c63e9b5a08a446ee0b3f0109b01d4fab4378825dd74c3f8ff915e6ca5dd52722d3a4accd59eab33f0afd14d1958307a0bf
7
- data.tar.gz: 6f2386902018a1a1d2a5097e3f4a997aca07417f03abdc5b50bee664da9f236b18d4d6c7059ced59bf0b45243dea5b7fbb5adadbc1eab54b595fd00c1fb1a478
6
+ metadata.gz: 520aaaba2a036bb83ef04b1a325a493072953ef56761c4b67ce1753a35071f09926057b3d76a3cf6c0da408bde00b5307fa889378e78840b8f9991f04466c191
7
+ data.tar.gz: 870f9916cf591e5bc33e2d0e054b7c9637bd51a5977dd3b8ce9cef89d45465bc85528443ad73d1a10d7c930d070246ec6d660d9aed4ed09f9c98afc2b598bded
@@ -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
- QueJobStatus.create!(job_id: job_id, attrs: attrs, status: 'executing')
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tanga_que_extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Van Dyk