dalli 0.9.9 → 0.9.10

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of dalli might be problematic. Click here for more details.

data/History.md CHANGED
@@ -1,6 +1,13 @@
1
1
  Dalli Changelog
2
2
  =====================
3
3
 
4
+ 0.9.10
5
+ ----
6
+
7
+ - Better server retry logic (next2you)
8
+ - Rails 3.1 compatibility (gucki)
9
+
10
+
4
11
  0.9.9
5
12
  ----
6
13
 
@@ -15,7 +22,7 @@ Dalli Changelog
15
22
  dc.set 'c', 3
16
23
  dc.delete 'd'
17
24
  end
18
- - Minor fix to set the continuum sorted by value.
25
+ - Minor fix to set the continuum sorted by value (kangster)
19
26
  - Implement session store with Rails 2.3. Update docs.
20
27
 
21
28
  0.9.8
@@ -46,8 +46,8 @@ module ActionDispatch
46
46
  [sid, session]
47
47
  end
48
48
 
49
- def set_session(env, sid, session_data)
50
- options = env['rack.session.options']
49
+ def set_session(env, sid, session_data, options = nil)
50
+ options ||= env[ENV_SESSION_OPTIONS_KEY]
51
51
  expiry = options[:expire_after] || 0
52
52
  @pool.set(sid, session_data, expiry)
53
53
  sid
@@ -16,7 +16,7 @@ module Dalli
16
16
  # :threadsafe - ensure that only one thread is actively using a socket at a time. Default: true.
17
17
  #
18
18
  def initialize(servers=nil, options={})
19
- @servers = servers || 'localhost:11211'
19
+ @servers = servers || env_servers || 'localhost:11211'
20
20
  @options = options
21
21
  end
22
22
 
@@ -152,7 +152,7 @@ module Dalli
152
152
 
153
153
  def ring
154
154
  @ring ||= Dalli::Ring.new(
155
- Array(env_servers || @servers).map do |s|
155
+ Array(@servers).map do |s|
156
156
  Dalli::Server.new(s)
157
157
  end, @options
158
158
  )
@@ -36,7 +36,17 @@ module Dalli
36
36
  end
37
37
 
38
38
  def alive?
39
- @sock && !@sock.closed?
39
+ return true if @sock && !@sock.closed?
40
+ return false if @down_at && @down_at == Time.now.to_i
41
+
42
+ begin
43
+ # try to reconnect at most once per second
44
+ connection
45
+ true
46
+ rescue Dalli::NetworkError => dne
47
+ Dalli.logger.info("Unable to connect to #{hostname}:#{port}: #{dne.message}")
48
+ down!
49
+ end
40
50
  end
41
51
 
42
52
  def close
@@ -295,7 +305,7 @@ module Dalli
295
305
  value = ''
296
306
  begin
297
307
  loop do
298
- value << socket.sysread(count)
308
+ value << socket.sysread(count - value.size)
299
309
  break if value.size == count
300
310
  end
301
311
  rescue Errno::EAGAIN, Errno::EWOULDBLOCK
@@ -1,3 +1,3 @@
1
1
  module Dalli
2
- VERSION = '0.9.9'
2
+ VERSION = '0.9.10'
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 9
8
- - 9
9
- version: 0.9.9
8
+ - 10
9
+ version: 0.9.10
10
10
  platform: ruby
11
11
  authors:
12
12
  - Mike Perham
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-10-06 00:00:00 -07:00
17
+ date: 2010-10-13 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency