easymon 1.6.1 → 1.6.3

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: 4a3712c0b6f801e51d8ea6c772e78822a34d3ceb96f8726ed7b1e49c9d176d89
4
- data.tar.gz: 69578f0bf9e951c067a7fb4cdfae3ef5970ba93f22507199f1574d5cb27287fb
3
+ metadata.gz: 82da9dec5eb66912f758fe04075ef2121f8c10d4659ab4c3b7cb79b43fc47bba
4
+ data.tar.gz: 03ef075f7573a79461e40e6924a1c0a57d8cafa6292b7381217a0e2dfe2aef06
5
5
  SHA512:
6
- metadata.gz: 5b5201d16b662203549c8c75187ee497be56340511633d65c0762ca880dc241c76f84fbea71dd23bc3bdcb9d190adf921b9016885dd2b66c7718aea1d56cfaae
7
- data.tar.gz: 4abf477bdf728f078780a5ef85539dc38fd4810d3cff48a468220b78d088ff41e57579fdc6c6b9a5dfce8fc887ffabd0e6b9178c0eb34ed603e00384ebbd8100
6
+ metadata.gz: 37b5c45c57e1fefb47d3eca2549d3bd5dc611697cb5c6efa577f94f8646c67e8240c38ef0de7021dc5f1a9de157fb06bd6ed9f40addeb74f180b61a78ee04912
7
+ data.tar.gz: 829e5f4a17106de067477d9ffc11d64fc631562a560732945e7b21a15d6b013b19fe49f0b96d7ab3c7e29b45cb3c84ebc23df6b018f450dee1acbd8613cecd9e
@@ -18,6 +18,7 @@ module Easymon
18
18
 
19
19
  private
20
20
  def database_up?
21
+ klass.connection.connect!
21
22
  klass.connection.active?
22
23
  rescue
23
24
  false
@@ -2,11 +2,9 @@ module Easymon
2
2
  class ActiveRecordMysqlWriteableCheck
3
3
  attr_accessor :klass
4
4
 
5
- def initialize(klass, makara = false)
5
+ def initialize(klass)
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
+ @query = "SELECT @@read_only for UPDATE"
10
8
  end
11
9
 
12
10
  def check
@@ -21,7 +19,7 @@ module Easymon
21
19
 
22
20
  private
23
21
  def database_writeable?
24
- klass.connection.execute(@query).entries.flatten.first == 0
22
+ klass.connection.execute(@query).to_enum.first.first.to_i == 0
25
23
  rescue
26
24
  false
27
25
  end
@@ -1,3 +1,3 @@
1
1
  module Easymon
2
- VERSION = "1.6.1"
2
+ VERSION = "1.6.3"
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.1
4
+ version: 1.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Anderson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-10 00:00:00.000000000 Z
11
+ date: 2024-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -175,14 +175,11 @@ files:
175
175
  - test/dummy/config/redis.yml
176
176
  - test/dummy/config/routes.rb
177
177
  - test/dummy/config/storage.yml
178
- - test/dummy/log/development.log
179
- - test/dummy/log/test.log
180
178
  - test/dummy/public/404.html
181
179
  - test/dummy/public/422.html
182
180
  - test/dummy/public/500.html
183
181
  - test/dummy/public/favicon.ico
184
182
  - test/dummy/script/rails
185
- - test/dummy/tmp/cache/4D4/7A0/health_check
186
183
  - test/helpers/easymon/checks_helper_test.rb
187
184
  - test/integration/navigation_test.rb
188
185
  - test/test_helper.rb
@@ -202,7 +199,7 @@ homepage: https://github.com/basecamp/easymon
202
199
  licenses:
203
200
  - MIT
204
201
  metadata: {}
205
- post_install_message:
202
+ post_install_message:
206
203
  rdoc_options: []
207
204
  require_paths:
208
205
  - lib
@@ -218,7 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
218
215
  version: '0'
219
216
  requirements: []
220
217
  rubygems_version: 3.1.6
221
- signing_key:
218
+ signing_key:
222
219
  specification_version: 4
223
220
  summary: Simple availability checks for your rails app
224
221
  test_files:
@@ -273,9 +270,6 @@ test_files:
273
270
  - test/dummy/public/422.html
274
271
  - test/dummy/public/500.html
275
272
  - test/dummy/public/404.html
276
- - test/dummy/log/test.log
277
- - test/dummy/log/development.log
278
- - test/dummy/tmp/cache/4D4/7A0/health_check
279
273
  - test/dummy/README.rdoc
280
274
  - test/integration/navigation_test.rb
281
275
  - test/test_helper.rb
@@ -1,24 +0,0 @@
1
-  (0.3ms) SET NAMES utf8, @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483
2
-  (1.4ms) CREATE DATABASE `dummy_development` DEFAULT CHARACTER SET `utf8`
3
-  (0.3ms) SET NAMES utf8, @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483
4
-  (1.0ms) CREATE DATABASE `dummy_test` DEFAULT CHARACTER SET `utf8`
5
-  (0.3ms) SET NAMES utf8, @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483
6
-  (0.3ms) SET NAMES utf8, @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483
7
-  (25.9ms) CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL PRIMARY KEY)
8
-  (20.9ms) CREATE TABLE `ar_internal_metadata` (`key` varchar(255) NOT NULL PRIMARY KEY, `value` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL)
9
-  (0.1ms) SELECT GET_LOCK('1721091371569202325', 0)
10
-  (0.2ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC
11
- ActiveRecord::InternalMetadata Load (0.2ms) SELECT `ar_internal_metadata`.* FROM `ar_internal_metadata` WHERE `ar_internal_metadata`.`key` = 'environment' LIMIT 1
12
-  (0.1ms) BEGIN
13
- ActiveRecord::InternalMetadata Create (0.2ms) INSERT INTO `ar_internal_metadata` (`key`, `value`, `created_at`, `updated_at`) VALUES ('environment', 'development', '2022-05-04 18:01:28', '2022-05-04 18:01:28')
14
-  (0.1ms) COMMIT
15
-  (0.1ms) SELECT RELEASE_LOCK('1721091371569202325')
16
-  (0.3ms) SELECT @@read_only
17
-  (0.2ms) SELECT @@read_only
18
-  (0.1ms) SELECT @@read_only
19
-  (0.8ms) SELECT @@read_only;
20
-  (0.9ms) SELECT @@read_only;
21
-  (3.2ms) SELECT @@read_only;
22
-  (0.2ms) SELECT @@read_only
23
-  (0.2ms) SELECT @@read_only;
24
-  (0.2ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC