tanga_que_extensions 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2eb174dd8964fc6e957f6660ce00d1dbfddd2f11
4
- data.tar.gz: fd98ac99df47dc27d19327f395ef6d82f7dec6db
3
+ metadata.gz: bd4fb1369cc92512494170941b78bf1fcffb22d7
4
+ data.tar.gz: a0ce3edfddad6ac61ac02cd62507d98d858801fb
5
5
  SHA512:
6
- metadata.gz: 08016b7ba01df2c8385bd50f1554a05ccbe805400f5ccfd5937853922e7baf974cd2cf7997659319b4055eb73c23e3f39729bed7d250f7854909ae7944dcbd7c
7
- data.tar.gz: 1d07473309ebd264e67887cf9f161e16f3949ba9f9357f9be99c5aa7bf1d03e5e124d148915499b4f704f28aad527b34d105e61551c01bf0e08a732d870f3d40
6
+ metadata.gz: 9dc32b0a622dfe165fdd28af9cdaa68b1584468dbdb7822558e4d1925fe89e648144f9dcd8218dfb2b0272dee981e3996a50acb0460a609fb9e32c6ab27444df
7
+ data.tar.gz: 1d5930ce060d826238fe21895831e74bb6a3098d36336f0f2b6e9c1606dbad7b989ef61f79be1cedf3f6df6f217838eba4bfe53a5271420ba3d29beb4da358fe
data/lib/que_job.rb ADDED
@@ -0,0 +1,3 @@
1
+ class QueJob < ActiveRecord::Base
2
+ self.primary_key = :job_id
3
+ end
@@ -0,0 +1,3 @@
1
+ class QueJobStatus < ActiveRecord::Base
2
+ self.table_name = :que_job_status
3
+ end
@@ -23,6 +23,7 @@ module Que::RecordJobStatus
23
23
  end
24
24
 
25
25
  def record_job_started
26
+ QueJobStatus.where(job_id: job_id).delete_all
26
27
  QueJobStatus.create!(job_id: job_id, attrs: attrs, status: 'executing')
27
28
  end
28
29
 
@@ -5,3 +5,5 @@ require_relative 'background_job_logger'
5
5
  require_relative 'record_job_status'
6
6
  require_relative 'job'
7
7
  require_relative 'notify_on_failures'
8
+ require_relative 'que_job'
9
+ require_relative 'que_job_status'
data/test/test.rb CHANGED
@@ -1,17 +1,15 @@
1
- require_relative '../lib/periodic_job'
2
1
  require 'active_support'
3
2
  require 'active_support/core_ext'
4
- require 'sequel'
5
3
  require 'json'
6
4
  require 'logger'
7
5
  require 'active_record'
6
+ require_relative '../lib/tanga_que_extensions'
8
7
 
9
8
  ActiveRecord::Base.establish_connection 'postgres://localhost/tanga_dev'
10
- Que.connection = Sequel.connect('postgres://localhost/tanga_dev')
9
+ Que.connection = ActiveRecord
11
10
 
12
- class QueJobStatus < ActiveRecord::Base
13
- self.table_name = :que_job_status
14
- end
11
+ p QueJobStatus.first
12
+ p QueJob.first
15
13
 
16
14
  class J < Que::Job
17
15
  prepend Que::RecordJobStatus
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tanga_que_extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
- - Peter van Wesep
7
+ - Joe Van Dyk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
@@ -24,9 +24,37 @@ dependencies:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.9.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: activerecord
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">"
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">"
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: pg
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">"
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">"
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
27
55
  description:
28
56
  email:
29
- - tanga.web.consultant@gmail.com
57
+ - joe@tanga.com
30
58
  executables: []
31
59
  extensions: []
32
60
  extra_rdoc_files: []
@@ -36,6 +64,8 @@ files:
36
64
  - lib/memory_info.rb
37
65
  - lib/notify_on_failures.rb
38
66
  - lib/periodic_job.rb
67
+ - lib/que_job.rb
68
+ - lib/que_job_status.rb
39
69
  - lib/record_job_status.rb
40
70
  - lib/tanga_que_extensions.rb
41
71
  - test/test.rb