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: cb55744be4fa12e4c7af34ae59091721967aaf08d1bd07e4bc0cca4bd2937c4a
4
- data.tar.gz: ed1822f256bea98b6982f634487c676fad7e292ca093c10315ce72990ffb6778
3
+ metadata.gz: 4a3712c0b6f801e51d8ea6c772e78822a34d3ceb96f8726ed7b1e49c9d176d89
4
+ data.tar.gz: 69578f0bf9e951c067a7fb4cdfae3ef5970ba93f22507199f1574d5cb27287fb
5
5
  SHA512:
6
- metadata.gz: bd39994e506c00177688ae9ecb7ff660326cc44eec4374cdeb42873c3128bec45da18dfb54969b9a6494fb0d79ef1d87be4d223c4ef162a70bfc5d4db4345e9a
7
- data.tar.gz: a6515ddbd1f7a0bce037815d8804c2c7689dfc943c1ad9c7f037d711ff41700efcc6367e261b2bd3a80b43590e30ef2523ec2bd639537aac7eada9fa5f000bbd
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("SELECT @@read_only").entries.flatten.first == 0
24
+ klass.connection.execute(@query).entries.flatten.first == 0
22
25
  rescue
23
26
  false
24
27
  end
@@ -1,3 +1,3 @@
1
1
  module Easymon
2
- VERSION = "1.6.0"
2
+ VERSION = "1.6.1"
3
3
  end
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.0
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-06 00:00:00.000000000 Z
11
+ date: 2022-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis