status_workflow 4.0.0 → 4.0.1

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: 9d96a5ee8dc5343ebab7ab98c447d79f7903ba0831ef1225de8c9da6e6127838
4
- data.tar.gz: '0139b6590a10230f353059e4e31d3d50c27e9717e1ffd68b0beb9bbea03e8a55'
3
+ metadata.gz: 1c974a37200e756f82b5de6b814a4a61172d96506dcd0cf2e6d1383a4744f070
4
+ data.tar.gz: ad90316c9b69c7ac63d36149793df79ad1d9e7f5904887794ed03ba3fe0f7314
5
5
  SHA512:
6
- metadata.gz: 745bb828ae26bc09ce89e0ffeb60f0b9596cfef4f66bc3d31ae63a14db1e35d9dc33837f1102a259249d800445328a728361f41f3260c8325118f94060669861
7
- data.tar.gz: fc999e463399151a1c22e0aae5522c2679339800e2f62c1f03b452f722280ee178b8447b80200ac4a3c3e4270d4d0d0430a1a4f1b66bb10e5b5b5d2005180f0e
6
+ metadata.gz: e08ff82347394f556e384e5b0baa64eab148ae0a5a87543d055cf373b80daff1ac1e541c18764c7238c7e75a59459cbdcf38219e64ebb1bed992a54564d88174
7
+ data.tar.gz: e3e57bfefb975b854cdf7037318cd88f0b98d9ce9ff831885164ebf0ebb312a769b1f468d1690678b0e9be972b6789c0d080af9f0bfc5d92e29924b124a01227
data/CHANGELOG CHANGED
@@ -1,3 +1,10 @@
1
+ 4.0.1 / 2018-12-06
2
+
3
+ Enhancements
4
+
5
+ * Simplify detection of lost locks
6
+ * Increase lock timeout to 8 seconds
7
+
1
8
  4.0.0 / 2018-11-14
2
9
 
3
10
  Breaking changes
@@ -19,7 +19,7 @@ module StatusWorkflow
19
19
  end
20
20
 
21
21
  LOCK_ACQUISITION_TIMEOUT = 8
22
- LOCK_EXPIRY = 4
22
+ LOCK_EXPIRY = 8
23
23
  LOCK_CHECK_RATE = 0.2
24
24
 
25
25
  def status_transition!(intermediate_to_status, final_to_status, prefix = nil)
@@ -45,10 +45,8 @@ module StatusWorkflow
45
45
  begin
46
46
  # depend on #can_enter_X to reload
47
47
  send "#{prefix_}can_enter_#{initial_to_status}?", true
48
- raise TooSlow, "#{lock_key} lost lock after checking status" if Time.now - lock_obtained_at > LOCK_EXPIRY
49
48
  if intermediate_to_status
50
49
  update_columns status_column => intermediate_to_status, status_changed_at_column => Time.now
51
- raise TooSlow, "#{lock_key} lost lock after setting intermediate status #{intermediate_to_status}" if Time.now - lock_obtained_at > LOCK_EXPIRY
52
50
  end
53
51
  # If a block was given, start a heartbeat thread
54
52
  if block_given?
@@ -74,7 +72,6 @@ module StatusWorkflow
74
72
  # Success!
75
73
  if intermediate_to_status
76
74
  send "#{prefix_}can_enter_#{final_to_status}?", true
77
- raise TooSlow, "#{lock_key} lost lock after checking final status" if Time.now - lock_obtained_at > LOCK_EXPIRY
78
75
  end
79
76
  update_columns status_column => final_to_status, status_changed_at_column => Time.now
80
77
  ensure
@@ -1,3 +1,3 @@
1
1
  module StatusWorkflow
2
- VERSION = '4.0.0'
2
+ VERSION = '4.0.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: status_workflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seamus Abshere
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-14 00:00:00.000000000 Z
11
+ date: 2018-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis