ae_active_job_state 0.3.0 → 1.0.0
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0338f082bb3d8bd8296112cb3dd7d39c5d4a4ad42296d07e22d3d9697641dd7d'
|
4
|
+
data.tar.gz: 2141b5061e74ad4b4b3e6e6d95a9a65124fc42cf7cc03106f478e8133c2a5748
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07f545138645e66fb211207c228f101ace34992dc9e6d47c1ce6994ea1d7fd3cfbf05f7c761c41d823313920e389005dc793ea586ec2d216cd976e1014c3971d
|
7
|
+
data.tar.gz: 61cc2f41cf1cf3de5a5856245072ec044fcddc0178cd816a2bbb270c439fc5eda8ee893afcb3ac20e22df7d7c0ba692e300ebc1b9dde2a997d20e88831f715de
|
@@ -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,18 +14,18 @@ module AeActiveJobState
|
|
14
14
|
state :finished
|
15
15
|
state :failed
|
16
16
|
|
17
|
-
event :
|
18
|
-
transitions
|
17
|
+
event :running do
|
18
|
+
transitions to: :running
|
19
19
|
after { update!(started_at: Time.now) }
|
20
20
|
end
|
21
21
|
|
22
|
-
event :
|
23
|
-
transitions
|
22
|
+
event :failed do
|
23
|
+
transitions to: :failed
|
24
24
|
after { update!(failed_at: Time.now) }
|
25
25
|
end
|
26
26
|
|
27
|
-
event :
|
28
|
-
transitions
|
27
|
+
event :finished do
|
28
|
+
transitions to: :finished
|
29
29
|
after { update!(finished_at: Time.now) }
|
30
30
|
end
|
31
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ae_active_job_state
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AppFolio
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aasm
|