Skip to content

Commit 290996e

Browse files
committed
Suppress outputs
1 parent 16cbff6 commit 290996e

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

lib/PostgresTools.pm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ sub BUILD {
7070
$self->rsync(0) unless $self->rsync;
7171
$self->port(5432) unless $self->port;
7272
$self->_create_excludes;
73-
say $self->port;
7473
}
7574

7675
sub analyze {

lib/PostgresTools/Date.pm

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ sub newer_than {
5454
my $self = shift;
5555
my $date = shift;
5656
return if !defined($date);
57-
my $offset = shift;
57+
my $offset = shift;
58+
local *STDERR;
59+
open( STDERR, '>>', '/dev/null' );
5860
my $now = dclone( $self->_now_ );
5961
my $duration = DateTime::Duration->new( days => $offset );
6062
my $old_date = $now->subtract_duration($duration);
@@ -65,8 +67,11 @@ sub older_than {
6567
my $self = shift;
6668
my $date = shift;
6769
return if !defined($date);
68-
my $offset = shift;
69-
my $now = dclone( $self->_now_ );
70+
my $offset = shift;
71+
open( my $STDOLD, '>&', STDERR );
72+
open( STDERR, '>>', '/dev/null' );
73+
my $now = dclone( $self->_now_ );
74+
open( STDOUT, '>&', $STDOLD );
7075
my $duration = DateTime::Duration->new( days => $offset );
7176
my $old_date = $now->subtract_duration($duration);
7277
return $date->subtract_datetime($old_date)->is_negative;
@@ -90,7 +95,10 @@ sub offset2date {
9095
my $self = shift;
9196
my $offset = shift;
9297
my $duration = DateTime::Duration->new( days => $offset );
93-
my $now = dclone( $self->_now_ );
98+
open( my $STDOLD, '>&', STDERR );
99+
open( STDERR, '>>', '/dev/null' );
100+
my $now = dclone( $self->_now_ );
101+
open( STDOUT, '>&', $STDOLD );
94102
return $now->subtract_duration($duration);
95103
}
96104

0 commit comments

Comments
 (0)