Skip to content

Commit e3ae488

Browse files
committed
timeout should not be a boolean and should always be cast as an integer
Set the default to 2 which matches the min default specified here: https://github.com/postgres/postgres/blob/REL_12_1/src/interfaces/libpq/fe-connect.c#L2005-L2012 Signed-off-by: Ben Abrams <me@benabrams.it>
1 parent 4990fc1 commit e3ae488

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

CHANGELOG.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@ This project adheres to [Semantic Versioning](http://semver.org/).
44
This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins/community/blob/master/HOW_WE_CHANGELOG.md).
55

66
## [Unreleased]
7+
8+
### Fixed
9+
- check-postgres-replication.rb: fix condition where connection timeout is considered a boolean rather than an integer value (@majormoses) (@phumpal) (@VeselaHouba)
10+
711
### Added
812
- `check-postgres-query.rb`: Add `-r`, `--regex-pattern` to match query result against (@jindraj)
913

1014
### Changes
1115
- Updated development dependency to bundler ~> 2.1
12-
- Updated development dependency to rake ~> 13.0
13-
- Updated development dependency to test-kitchen ~> 1.25.0
14-
- Updated runtime dependency to 'pg' '1.2.1' from 1.1
16+
- Updated development dependency to rake ~> 13.0
17+
- Updated development dependency to test-kitchen ~> 1.25.0
18+
- Updated runtime dependency to 'pg' '1.2.1' from 1.1
1519
- Updated runtime dependency 'dentaku' '3.3.4' from 2.04
1620

1721
### Breaking Changes

bin/check-postgres-replication.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,11 @@ class CheckPostgresReplicationStatus < Sensu::Plugin::Check::CLI
9494
proc: lambda { |s| s.to_i }) # rubocop:disable Lambda
9595

9696
option(:timeout,
97-
short: '-T',
98-
long: '--timeout',
99-
default: nil,
100-
description: 'Connection timeout (seconds)')
97+
short: '-T TIMEOUT',
98+
long: '--timeout=TIMEOUT',
99+
default: 2,
100+
description: 'Connection timeout (seconds)',
101+
proc: proc(&:to_i))
101102

102103
include Pgpass
103104
include PgUtil

0 commit comments

Comments
 (0)