distribute_reads 0.3.2 → 0.3.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: 9ad9e2810c10045d79634ef7988435c059e99f8585667edf59d831797b258925
4
- data.tar.gz: 7e3f7bbb5c96192910dc6a114147ddcf0c1258bcaed74491efdfb6ad20aaf20b
3
+ metadata.gz: b3e0ef8f494561b701bc58c7119865cf0ff1693364352a218a9a2da9e0fb4060
4
+ data.tar.gz: 14b0a9907a9f0592f2c520f325ab689f3ca0eeef924ab89edef698cbbb47bcea
5
5
  SHA512:
6
- metadata.gz: 626a85f8a972d3e786ed1f705b2fef2e0da53c20d1a1d02d620d60de61014b493055f373f422050504c2760d86a4e71b0097f7a946c436dcc3ccb7fa80c5c00a
7
- data.tar.gz: 76c312011e3c5bd4383ccf768b37a9d81800d022c7dfaeca29ad4384bf68f97c2789708609ea64b94a1a81d3e5c5b62836907d9d786150a3b1251069e9d7c14c
6
+ metadata.gz: 8b0da6908431d10090a1c942357ef8bfb2fc1dfe480774dabaab873bebf6c4baea1a184d429ec7907d58b18b23c00ff947583c2b7f716055a7224bb98e3c0e0d
7
+ data.tar.gz: 2deb9025f60388bb65b03c5f4e27a7f3c8a10d9b174c463437e235a4b07f4eb8f2903e9b87c1d1b3ffd430a2ba4871bb97dc492b318ce13409f2fe775cf88c00
@@ -1,3 +1,7 @@
1
+ ## 0.3.3 (2020-05-06)
2
+
3
+ - Fixed deprecation warning with MySQL
4
+
1
5
  ## 0.3.2 (2020-01-02)
2
6
 
3
7
  - Added `eager_load` option
@@ -45,7 +45,7 @@ module DistributeReads
45
45
  # cache the version number
46
46
  @server_version_num ||= {}
47
47
  cache_key = connection.pool.object_id
48
- @server_version_num[cache_key] ||= connection.execute("SHOW server_version_num").first["server_version_num"].to_i
48
+ @server_version_num[cache_key] ||= connection.select_all("SHOW server_version_num").first["server_version_num"].to_i
49
49
 
50
50
  lag_condition =
51
51
  if @server_version_num[cache_key] >= 100000
@@ -54,7 +54,7 @@ module DistributeReads
54
54
  "pg_last_xlog_receive_location() = pg_last_xlog_replay_location()"
55
55
  end
56
56
 
57
- connection.execute(
57
+ connection.select_all(
58
58
  "SELECT CASE
59
59
  WHEN NOT pg_is_in_recovery() OR #{lag_condition} THEN 0
60
60
  ELSE EXTRACT (EPOCH FROM NOW() - pg_last_xact_replay_timestamp())
@@ -66,14 +66,14 @@ module DistributeReads
66
66
 
67
67
  unless @aurora_mysql.key?(cache_key)
68
68
  # makara doesn't send SHOW queries to replica by default
69
- @aurora_mysql[cache_key] = connection.exec_query("SHOW VARIABLES LIKE 'aurora_version'").to_hash.any?
69
+ @aurora_mysql[cache_key] = connection.select_all("SHOW VARIABLES LIKE 'aurora_version'").any?
70
70
  end
71
71
 
72
72
  if @aurora_mysql[cache_key]
73
- status = connection.exec_query("SELECT Replica_lag_in_msec FROM mysql.ro_replica_status WHERE Server_id = @@aurora_server_id").to_hash.first
73
+ status = connection.select_all("SELECT Replica_lag_in_msec FROM mysql.ro_replica_status WHERE Server_id = @@aurora_server_id").first
74
74
  status ? status["Replica_lag_in_msec"].to_f / 1000.0 : 0.0
75
75
  else
76
- status = connection.exec_query("SHOW SLAVE STATUS").to_hash.first
76
+ status = connection.select_all("SHOW SLAVE STATUS").first
77
77
  if status
78
78
  if status["Seconds_Behind_Master"].nil?
79
79
  # replication stopped
@@ -1,3 +1,3 @@
1
1
  module DistributeReads
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: distribute_reads
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-02 00:00:00.000000000 Z
11
+ date: 2020-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: makara