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: 706322d5333d170413b8ea10f6828e23b97f7276fb1c3f4be925b4e1d3998612
4
- data.tar.gz: 81fe635701a0c541832a7daf7a52d5a262e88ff4332eacbdf85ed3ee03a302b5
3
+ metadata.gz: '0338f082bb3d8bd8296112cb3dd7d39c5d4a4ad42296d07e22d3d9697641dd7d'
4
+ data.tar.gz: 2141b5061e74ad4b4b3e6e6d95a9a65124fc42cf7cc03106f478e8133c2a5748
5
5
  SHA512:
6
- metadata.gz: 6ec715060434b6d894f83892b7d2e168fbd1de45b4375e9e9d697ef9037f7f661c52f4dda008b87c7450cc92ba34078d73978d436f4d0ca28d81eca8b3bdc417
7
- data.tar.gz: 50d2d323c6c6dfb6d6e42b9cbd79a135208a04fb93e0fa99389947cf1e73f61c1234755d5b69b1bbdcb8a37c9f0e319f01bdcb1e29755f45e0f1e2525e973aba
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.run!
39
+ job_state.running!
40
40
  job_state.reload
41
41
  block.call
42
- job_state.finish!
42
+ job_state.finished!
43
43
  rescue StandardError => e
44
- @job_state.fail!
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 :run do
18
- transitions from: %w[pending failed], to: :running
17
+ event :running do
18
+ transitions to: :running
19
19
  after { update!(started_at: Time.now) }
20
20
  end
21
21
 
22
- event :fail do
23
- transitions from: :running, to: :failed
22
+ event :failed do
23
+ transitions to: :failed
24
24
  after { update!(failed_at: Time.now) }
25
25
  end
26
26
 
27
- event :finish do
28
- transitions from: :running, to: :finished
27
+ event :finished do
28
+ transitions to: :finished
29
29
  after { update!(finished_at: Time.now) }
30
30
  end
31
31
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AeActiveJobState
4
- VERSION = '0.3.0'
4
+ VERSION = '1.0.0'
5
5
  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.3.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-03-24 00:00:00.000000000 Z
11
+ date: 2021-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aasm