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 +4 -4
- data/ChangeLog +5 -0
- data/lib/perfectqueue/backend/rdb_compat.rb +7 -1
- data/lib/perfectqueue/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f2a4de693be6fb67cec8c761d949996d4aab365
|
4
|
+
data.tar.gz: 9ae56885f1e52d7e5e685e754ae3ec971d0abc05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9cf308fbeaced67ee174de205e12d443ae96fcd695406c217cd6e254fcdba31632850ec734cab875126cb79e474b90642bde7a47b8a821665750f7e72bc4e0f4
|
7
|
+
data.tar.gz: c95228db876ba2427b1b2b288abd76cb245583afabaaadb827bdd29bffa84cfb4a8830a6e6f5a0058b6c068882cfe9b8556102d3c959b3dd60c8b9c5253106a1
|
data/ChangeLog
CHANGED
@@ -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 =
|
124
|
+
LOCK_WAIT_TIMEOUT = 10
|
119
125
|
DEFAULT_DELETE_INTERVAL = 20
|
120
126
|
|
121
127
|
def init_database(options)
|
data/lib/perfectqueue/version.rb
CHANGED
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.
|
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-
|
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
|