distributed_mutex 1.1.6 → 1.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/lib/mysql_mutex.rb +6 -4
- metadata +23 -16
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.7
|
data/lib/mysql_mutex.rb
CHANGED
@@ -7,10 +7,12 @@ class MySQLMutex < DistributedMutex
|
|
7
7
|
|
8
8
|
def initialize(key, timeout = DEFAULT_TIMEOUT, exception_on_timeout = DEFAULT_EXCEPTION_ON_TIMEOUT, connection = ActiveRecord::Base.connection)
|
9
9
|
super(key, timeout, exception_on_timeout)
|
10
|
-
|
11
|
-
|
12
|
-
@
|
13
|
-
@
|
10
|
+
sanitized_key = connection.quote(key)
|
11
|
+
sanitized_timeout = connection.quote(timeout)
|
12
|
+
@connection = connection
|
13
|
+
@connection_id = connection.show_variable('pseudo_thread_id')
|
14
|
+
@get_sql = "SELECT GET_LOCK(#{sanitized_key},#{sanitized_timeout})"
|
15
|
+
@release_sql = "SELECT RELEASE_LOCK(#{sanitized_key})"
|
14
16
|
end
|
15
17
|
|
16
18
|
def self.synchronize(key, timeout = DEFAULT_TIMEOUT, exception_on_timeout = DEFAULT_TIMEOUT, con = ActiveRecord::Base.connection, &block)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: distributed_mutex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 7
|
10
|
+
version: 1.1.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Birkir A. Barkarson
|
@@ -15,13 +15,13 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-01
|
18
|
+
date: 2012-11-01 00:00:00 +09:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
|
-
name: activerecord
|
23
22
|
prerelease: false
|
24
|
-
|
23
|
+
name: activerecord
|
24
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
@@ -31,12 +31,19 @@ dependencies:
|
|
31
31
|
- 2
|
32
32
|
- 3
|
33
33
|
version: "2.3"
|
34
|
+
- - <
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
hash: 7
|
37
|
+
segments:
|
38
|
+
- 3
|
39
|
+
- 0
|
40
|
+
version: "3.0"
|
41
|
+
requirement: *id001
|
34
42
|
type: :runtime
|
35
|
-
version_requirements: *id001
|
36
43
|
- !ruby/object:Gem::Dependency
|
37
|
-
name: mysql
|
38
44
|
prerelease: false
|
39
|
-
|
45
|
+
name: mysql
|
46
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
40
47
|
none: false
|
41
48
|
requirements:
|
42
49
|
- - ">="
|
@@ -45,12 +52,12 @@ dependencies:
|
|
45
52
|
segments:
|
46
53
|
- 0
|
47
54
|
version: "0"
|
55
|
+
requirement: *id002
|
48
56
|
type: :runtime
|
49
|
-
version_requirements: *id002
|
50
57
|
- !ruby/object:Gem::Dependency
|
51
|
-
name: jeweler
|
52
58
|
prerelease: false
|
53
|
-
|
59
|
+
name: jeweler
|
60
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
54
61
|
none: false
|
55
62
|
requirements:
|
56
63
|
- - ">="
|
@@ -59,12 +66,12 @@ dependencies:
|
|
59
66
|
segments:
|
60
67
|
- 0
|
61
68
|
version: "0"
|
69
|
+
requirement: *id003
|
62
70
|
type: :development
|
63
|
-
version_requirements: *id003
|
64
71
|
- !ruby/object:Gem::Dependency
|
65
|
-
name: rspec
|
66
72
|
prerelease: false
|
67
|
-
|
73
|
+
name: rspec
|
74
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
68
75
|
none: false
|
69
76
|
requirements:
|
70
77
|
- - ">="
|
@@ -73,8 +80,8 @@ dependencies:
|
|
73
80
|
segments:
|
74
81
|
- 0
|
75
82
|
version: "0"
|
83
|
+
requirement: *id004
|
76
84
|
type: :development
|
77
|
-
version_requirements: *id004
|
78
85
|
description: Framework for using a distributed mutex along with an implementation of a mutex stored on a MySQL database.
|
79
86
|
email: birkirb@stoicviking.net
|
80
87
|
executables: []
|