ae_active_job_state 0.3.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/ae_active_job_state.gemspec +18 -15
- data/lib/ae_active_job_state/has_job_state.rb +3 -3
- data/lib/ae_active_job_state/job_state.rb +6 -9
- data/lib/ae_active_job_state/version.rb +1 -1
- metadata +20 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27577d3a5f8d80f06587a891c73c706bdb3ca0739247d94ddbed044f305dc652
|
4
|
+
data.tar.gz: 1e33ab5fb93a7967ef972778ae44b84bf6caa1481bb66a0b15f896dc8aab6955
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 825d24c8a500b3af1d6a98cd2e035b7f7a071cfa3041ed5e6df3992fa8bac1dda3179fbf0f2245b972bdc0f912e615beac615648eead79b7176460dbfdef915b
|
7
|
+
data.tar.gz: 6e3ce3de3483b00da0acce5aba7c1c17fc980cdb05b6ef288d57351734facce5618260db20e6645f27f5593a5cd390bb020675b4de6aefe05d28999b0d42c950
|
data/LICENSE.txt
CHANGED
data/ae_active_job_state.gemspec
CHANGED
@@ -3,20 +3,23 @@
|
|
3
3
|
require_relative 'lib/ae_active_job_state/version'
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
|
-
spec.name
|
7
|
-
spec.version
|
8
|
-
spec.platform
|
9
|
-
spec.author
|
10
|
-
spec.email
|
11
|
-
spec.description
|
12
|
-
spec.summary
|
13
|
-
spec.homepage
|
14
|
-
spec.license
|
15
|
-
spec.files
|
16
|
-
spec.require_paths
|
6
|
+
spec.name = 'ae_active_job_state'
|
7
|
+
spec.version = AeActiveJobState::VERSION
|
8
|
+
spec.platform = Gem::Platform::RUBY
|
9
|
+
spec.author = 'AppFolio'
|
10
|
+
spec.email = 'opensource@appfolio.com'
|
11
|
+
spec.description = 'Store ActiveJob status in ActiveRecord'
|
12
|
+
spec.summary = spec.description
|
13
|
+
spec.homepage = 'https://github.com/appfolio/ae_active_job_state'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
spec.files = Dir['**/*'].select { |f| f[%r{^(lib/|LICENSE.txt|.*gemspec)}] }
|
16
|
+
spec.require_paths = ['lib']
|
17
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 2.6.3')
|
17
18
|
|
18
|
-
spec.
|
19
|
-
|
20
|
-
spec.add_dependency
|
21
|
-
spec.add_dependency
|
19
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
20
|
+
|
21
|
+
spec.add_dependency('aasm', ['>= 5.1', '< 6'])
|
22
|
+
spec.add_dependency('activejob', ['>= 6', '< 7.1'])
|
23
|
+
spec.add_dependency('activerecord', ['>= 6', '< 7.1'])
|
24
|
+
spec.add_dependency('activesupport', ['>= 6', '< 7.1'])
|
22
25
|
end
|
@@ -36,12 +36,12 @@ module AeActiveJobState
|
|
36
36
|
@job_state = AeActiveJobState::JobState.find_by!(active_job_id: job.job_id)
|
37
37
|
end
|
38
38
|
|
39
|
-
job_state.
|
39
|
+
job_state.running!
|
40
40
|
job_state.reload
|
41
41
|
block.call
|
42
|
-
job_state.
|
42
|
+
job_state.finished!
|
43
43
|
rescue StandardError => e
|
44
|
-
@job_state.
|
44
|
+
@job_state.failed!
|
45
45
|
raise e
|
46
46
|
end
|
47
47
|
end
|
@@ -14,19 +14,16 @@ module AeActiveJobState
|
|
14
14
|
state :finished
|
15
15
|
state :failed
|
16
16
|
|
17
|
-
event :
|
18
|
-
transitions
|
19
|
-
after { update!(started_at: Time.now) }
|
17
|
+
event :running do
|
18
|
+
transitions to: :running, after: -> { self.started_at = Time.now }
|
20
19
|
end
|
21
20
|
|
22
|
-
event :
|
23
|
-
transitions
|
24
|
-
after { update!(failed_at: Time.now) }
|
21
|
+
event :failed do
|
22
|
+
transitions to: :failed, after: -> { self.failed_at = Time.now }
|
25
23
|
end
|
26
24
|
|
27
|
-
event :
|
28
|
-
transitions
|
29
|
-
after { update!(finished_at: Time.now) }
|
25
|
+
event :finished do
|
26
|
+
transitions to: :finished, after: -> { self.finished_at = Time.now }
|
30
27
|
end
|
31
28
|
end
|
32
29
|
end
|
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ae_active_job_state
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AppFolio
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aasm
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '5.1'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '6'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '5.1'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '6'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: activejob
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -33,7 +39,7 @@ dependencies:
|
|
33
39
|
version: '6'
|
34
40
|
- - "<"
|
35
41
|
- !ruby/object:Gem::Version
|
36
|
-
version: '7'
|
42
|
+
version: '7.1'
|
37
43
|
type: :runtime
|
38
44
|
prerelease: false
|
39
45
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -43,7 +49,7 @@ dependencies:
|
|
43
49
|
version: '6'
|
44
50
|
- - "<"
|
45
51
|
- !ruby/object:Gem::Version
|
46
|
-
version: '7'
|
52
|
+
version: '7.1'
|
47
53
|
- !ruby/object:Gem::Dependency
|
48
54
|
name: activerecord
|
49
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,7 +59,7 @@ dependencies:
|
|
53
59
|
version: '6'
|
54
60
|
- - "<"
|
55
61
|
- !ruby/object:Gem::Version
|
56
|
-
version: '7'
|
62
|
+
version: '7.1'
|
57
63
|
type: :runtime
|
58
64
|
prerelease: false
|
59
65
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -63,7 +69,7 @@ dependencies:
|
|
63
69
|
version: '6'
|
64
70
|
- - "<"
|
65
71
|
- !ruby/object:Gem::Version
|
66
|
-
version: '7'
|
72
|
+
version: '7.1'
|
67
73
|
- !ruby/object:Gem::Dependency
|
68
74
|
name: activesupport
|
69
75
|
requirement: !ruby/object:Gem::Requirement
|
@@ -73,7 +79,7 @@ dependencies:
|
|
73
79
|
version: '6'
|
74
80
|
- - "<"
|
75
81
|
- !ruby/object:Gem::Version
|
76
|
-
version: '7'
|
82
|
+
version: '7.1'
|
77
83
|
type: :runtime
|
78
84
|
prerelease: false
|
79
85
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -83,7 +89,7 @@ dependencies:
|
|
83
89
|
version: '6'
|
84
90
|
- - "<"
|
85
91
|
- !ruby/object:Gem::Version
|
86
|
-
version: '7'
|
92
|
+
version: '7.1'
|
87
93
|
description: Store ActiveJob status in ActiveRecord
|
88
94
|
email: opensource@appfolio.com
|
89
95
|
executables: []
|
@@ -103,7 +109,8 @@ files:
|
|
103
109
|
homepage: https://github.com/appfolio/ae_active_job_state
|
104
110
|
licenses:
|
105
111
|
- MIT
|
106
|
-
metadata:
|
112
|
+
metadata:
|
113
|
+
allowed_push_host: https://rubygems.org
|
107
114
|
post_install_message:
|
108
115
|
rdoc_options: []
|
109
116
|
require_paths:
|
@@ -112,14 +119,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
112
119
|
requirements:
|
113
120
|
- - ">="
|
114
121
|
- !ruby/object:Gem::Version
|
115
|
-
version:
|
122
|
+
version: 2.6.3
|
116
123
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
124
|
requirements:
|
118
125
|
- - ">="
|
119
126
|
- !ruby/object:Gem::Version
|
120
127
|
version: '0'
|
121
128
|
requirements: []
|
122
|
-
rubygems_version: 3.
|
129
|
+
rubygems_version: 3.3.3
|
123
130
|
signing_key:
|
124
131
|
specification_version: 4
|
125
132
|
summary: Store ActiveJob status in ActiveRecord
|