nofxx-tokyo_store 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/rack/session/tokyo.rb +8 -1
- data/tokyo_store.gemspec +2 -2
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/lib/rack/session/tokyo.rb
CHANGED
@@ -8,7 +8,10 @@ module Rack
|
|
8
8
|
super
|
9
9
|
@mutex = Mutex.new
|
10
10
|
@host, @port = *(options[:tyrant_server] || @default_options[:tyrant_server]).split(":") # @default_options) #options[:cache] ||
|
11
|
-
|
11
|
+
# connecting & closing on each get and put
|
12
|
+
# not sure if this is the best option, but otherwise it'll keep
|
13
|
+
# opening connections until tyrant freezes... =/
|
14
|
+
# tokyo_connect
|
12
15
|
end
|
13
16
|
|
14
17
|
private
|
@@ -21,6 +24,7 @@ module Rack
|
|
21
24
|
end
|
22
25
|
|
23
26
|
def get_session(env, sid)
|
27
|
+
tokyo_connect
|
24
28
|
@mutex.lock if env['rack.multithread']
|
25
29
|
session = Marshal.load(@pool[sid]) rescue session if sid && session = @pool[sid]
|
26
30
|
unless sid && session
|
@@ -36,9 +40,11 @@ module Rack
|
|
36
40
|
session = {}
|
37
41
|
ensure
|
38
42
|
@mutex.unlock if env['rack.multithread']
|
43
|
+
@pool.close
|
39
44
|
end
|
40
45
|
|
41
46
|
def set_session(env, sid, new_session, options)
|
47
|
+
tokyo_connect
|
42
48
|
@mutex.lock if env['rack.multithread']
|
43
49
|
session = Marshal.load(session) rescue session if session = @pool[sid]
|
44
50
|
if options[:renew] || options[:drop]
|
@@ -56,6 +62,7 @@ module Rack
|
|
56
62
|
warn $!.inspect
|
57
63
|
ensure
|
58
64
|
@mutex.unlock if env['rack.multithread']
|
65
|
+
@pool.close
|
59
66
|
end
|
60
67
|
|
61
68
|
def generate_sid
|
data/tokyo_store.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{tokyo_store}
|
5
|
-
s.version = "0.2.
|
5
|
+
s.version = "0.2.1"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Marcos Piccinini"]
|
9
|
-
s.date = %q{2009-07-
|
9
|
+
s.date = %q{2009-07-18}
|
10
10
|
s.email = %q{x@nofxx.com}
|
11
11
|
s.extra_rdoc_files = [
|
12
12
|
"LICENSE",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nofxx-tokyo_store
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcos Piccinini
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-07-
|
12
|
+
date: 2009-07-18 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|