pg-locks-monitor 0.2.1 → 0.2.2

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: c15914dcf0512070ba0f629249a9743c04aad078d6f7dcd23a96acda248284f4
4
- data.tar.gz: bbf242ededb3f441489be230e5e013d362c85b0964f34667a89b9ffe12589aa0
3
+ metadata.gz: 170cb606bd1459b6b1a7525ed08ce17f2aab0757703ec9a33f64dadeafdebf7c
4
+ data.tar.gz: 503f92da91e4ca9d03999c45abb50507f8888b209df33c4a0e8b87e4cfdcb6b5
5
5
  SHA512:
6
- metadata.gz: c17edd2b3419837fd7e6f909ba8f7bf2878a28df97f0f80f0a2a12e5534188895d44f3897372445267ff8d524f1b1825d09c4a77b29ad8a991dedd4b71ba4dfb
7
- data.tar.gz: a876c3894b680a8cc20bb29070d1e9dc8af6678cd09ed6293501ede52eecae134ddfb48b37d7441676f9a9f4499f8b0f2eba46108b963da19ebf8f6ef78992ee
6
+ metadata.gz: 27d0ac7d4340b0de7739b6383ec203830ab92eb5b952cbc41b9447c6d41aa540d52522f067bd1cdd857802c6c8a49a16ddaff9b95f2c51beed0f3e3b8dae6022
7
+ data.tar.gz: b4594194b88910f3fcc2e9c7e79205147076ff0fcd6ccf79ca2bc0e7e4290a3d5167e041f7660e72ecdfff1e7fe598684f103256a976582c83c884b8639dc77d
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "uri"
4
4
  require "pg"
5
+ require "ruby-pg-extras"
5
6
 
6
7
  module PgLocksMonitor
7
8
  def self.snapshot!
@@ -14,7 +15,7 @@ module PgLocksMonitor
14
15
  end.select(&configuration.locks_filter_proc)
15
16
  .first(configuration.locks_limit)
16
17
 
17
- if locks.present? && configuration.monitor_locks
18
+ if locks.count > 0 && configuration.monitor_locks
18
19
  configuration.notifier_class.call(locks)
19
20
  end
20
21
 
@@ -23,7 +24,7 @@ module PgLocksMonitor
23
24
  end.select(&configuration.blocking_filter_proc)
24
25
  .first(configuration.locks_limit)
25
26
 
26
- if blocking.present? && configuration.monitor_blocking
27
+ if blocking.count > 0 && configuration.monitor_blocking
27
28
  configuration.notifier_class.call(blocking)
28
29
  end
29
30
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgLocksMonitor
4
- VERSION = "0.2.1"
4
+ VERSION = "0.2.2"
5
5
  end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "spec_helper"
4
+
5
+ describe PgLocksMonitor do
6
+ describe "snapshot!" do
7
+ it "works" do
8
+ expect {
9
+ PgLocksMonitor.snapshot!
10
+ }.not_to raise_error
11
+ end
12
+ end
13
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg-locks-monitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - pawurb
@@ -105,6 +105,7 @@ files:
105
105
  - pg-locks-monitor.gemspec
106
106
  - spec/configuration_spec.rb
107
107
  - spec/default_notifier_spec.rb
108
+ - spec/smoke_spec.rb
108
109
  - spec/spec_helper.rb
109
110
  homepage: http://github.com/pawurb/pg-locks-monitor
110
111
  licenses:
@@ -133,4 +134,5 @@ summary: Observe PostgreSQL database locks obtained by a Rails application.
133
134
  test_files:
134
135
  - spec/configuration_spec.rb
135
136
  - spec/default_notifier_spec.rb
137
+ - spec/smoke_spec.rb
136
138
  - spec/spec_helper.rb