easymon 1.6.0 → 1.6.1
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a3712c0b6f801e51d8ea6c772e78822a34d3ceb96f8726ed7b1e49c9d176d89
|
4
|
+
data.tar.gz: 69578f0bf9e951c067a7fb4cdfae3ef5970ba93f22507199f1574d5cb27287fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b5201d16b662203549c8c75187ee497be56340511633d65c0762ca880dc241c76f84fbea71dd23bc3bdcb9d190adf921b9016885dd2b66c7718aea1d56cfaae
|
7
|
+
data.tar.gz: 4abf477bdf728f078780a5ef85539dc38fd4810d3cff48a468220b78d088ff41e57579fdc6c6b9a5dfce8fc887ffabd0e6b9178c0eb34ed603e00384ebbd8100
|
@@ -2,8 +2,11 @@ module Easymon
|
|
2
2
|
class ActiveRecordMysqlWriteableCheck
|
3
3
|
attr_accessor :klass
|
4
4
|
|
5
|
-
def initialize(klass)
|
5
|
+
def initialize(klass, makara = false)
|
6
6
|
self.klass = klass
|
7
|
+
@query = "SELECT @@read_only"
|
8
|
+
# Trick makara into using the primary db
|
9
|
+
@query += " for UPDATE" if makara
|
7
10
|
end
|
8
11
|
|
9
12
|
def check
|
@@ -18,7 +21,7 @@ module Easymon
|
|
18
21
|
|
19
22
|
private
|
20
23
|
def database_writeable?
|
21
|
-
klass.connection.execute(
|
24
|
+
klass.connection.execute(@query).entries.flatten.first == 0
|
22
25
|
rescue
|
23
26
|
false
|
24
27
|
end
|
data/lib/easymon/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easymon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Anderson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|