perfectqueue 0.8.49 → 0.8.50

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: 61295f3241d66b1d9f27aac68294e32344b09611
4
- data.tar.gz: 36371652be7e64c3d5c1b79396c37ff8f5e5344c
3
+ metadata.gz: 3f2a4de693be6fb67cec8c761d949996d4aab365
4
+ data.tar.gz: 9ae56885f1e52d7e5e685e754ae3ec971d0abc05
5
5
  SHA512:
6
- metadata.gz: 2461e220ce8b2f45308db2f377b0816718c4222bc70bcdefec5b6c6fe2df0b3938b7e5d5ff87ad2888b7f20133c91d132a333aa9c0578928a231cb9e8f72b312
7
- data.tar.gz: ba6542077acbf7e914c22a90afbcd54833d6e06e42781e8d62300b8d74cda1dfdf29eb5f7bfcb90f3788547828bc79c9cf61e74676127f29b879b2b00f8878d9
6
+ metadata.gz: 9cf308fbeaced67ee174de205e12d443ae96fcd695406c217cd6e254fcdba31632850ec734cab875126cb79e474b90642bde7a47b8a821665750f7e72bc4e0f4
7
+ data.tar.gz: c95228db876ba2427b1b2b288abd76cb245583afabaaadb827bdd29bffa84cfb4a8830a6e6f5a0058b6c068882cfe9b8556102d3c959b3dd60c8b9c5253106a1
data/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ == 2016-08-18 version 0.8.50
2
+
3
+ * Decrease GET_LOCK timeout from 60 to 10 seconds
4
+ * Add 0.5 to 30 seconds of sleep between GET_LOCK retrying
5
+
1
6
  == 2016-08-02 version 0.8.49
2
7
 
3
8
  * Revert v0.8.44 migration path (#38)
@@ -33,6 +33,9 @@ module PerfectQueue
33
33
  DELETE_OFFSET = 10_0000_0000
34
34
  EVENT_HORIZON = 13_0000_0000 # 2011-03-13 07:06:40 UTC
35
35
 
36
+ LOCK_RETRY_INITIAL_INTERVAL = 0.5
37
+ LOCK_RETRY_MAX_INTERVAL = 30
38
+
36
39
  class Token < Struct.new(:key)
37
40
  end
38
41
 
@@ -54,11 +57,14 @@ module PerfectQueue
54
57
  end
55
58
  @table_lock = lambda {
56
59
  locked = nil
60
+ interval = LOCK_RETRY_INITIAL_INTERVAL
57
61
  loop do
58
62
  @db.fetch("SELECT GET_LOCK('#{@table}', #{LOCK_WAIT_TIMEOUT}) locked") do |row|
59
63
  locked = true if row[:locked] == 1
60
64
  end
61
65
  break if locked
66
+ sleep interval
67
+ interval = [interval * 2, LOCK_RETRY_MAX_INTERVAL].min
62
68
  end
63
69
  }
64
70
  @table_unlock = lambda {
@@ -115,7 +121,7 @@ SQL
115
121
 
116
122
  KEEPALIVE = 10
117
123
  MAX_RETRY = 10
118
- LOCK_WAIT_TIMEOUT = 60
124
+ LOCK_WAIT_TIMEOUT = 10
119
125
  DEFAULT_DELETE_INTERVAL = 20
120
126
 
121
127
  def init_database(options)
@@ -1,3 +1,3 @@
1
1
  module PerfectQueue
2
- VERSION = "0.8.49"
2
+ VERSION = "0.8.50"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: perfectqueue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.49
4
+ version: 0.8.50
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-02 00:00:00.000000000 Z
11
+ date: 2016-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel
@@ -208,4 +208,3 @@ test_files:
208
208
  - spec/task_metadata_spec.rb
209
209
  - spec/task_monitor_spec.rb
210
210
  - spec/task_spec.rb
211
- has_rdoc: false