Skip to content

Commit

Permalink
Suppress outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
roa committed Apr 24, 2017
1 parent 16cbff6 commit 290996e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
1 change: 0 additions & 1 deletion lib/PostgresTools.pm
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ sub BUILD {
$self->rsync(0) unless $self->rsync;
$self->port(5432) unless $self->port;
$self->_create_excludes;
say $self->port;
}

sub analyze {
Expand Down
16 changes: 12 additions & 4 deletions lib/PostgresTools/Date.pm
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ sub newer_than {
my $self = shift;
my $date = shift;
return if !defined($date);
my $offset = shift;
my $offset = shift;
local *STDERR;
open( STDERR, '>>', '/dev/null' );
my $now = dclone( $self->_now_ );
my $duration = DateTime::Duration->new( days => $offset );
my $old_date = $now->subtract_duration($duration);
Expand All @@ -65,8 +67,11 @@ sub older_than {
my $self = shift;
my $date = shift;
return if !defined($date);
my $offset = shift;
my $now = dclone( $self->_now_ );
my $offset = shift;
open( my $STDOLD, '>&', STDERR );
open( STDERR, '>>', '/dev/null' );
my $now = dclone( $self->_now_ );
open( STDOUT, '>&', $STDOLD );
my $duration = DateTime::Duration->new( days => $offset );
my $old_date = $now->subtract_duration($duration);
return $date->subtract_datetime($old_date)->is_negative;
Expand All @@ -90,7 +95,10 @@ sub offset2date {
my $self = shift;
my $offset = shift;
my $duration = DateTime::Duration->new( days => $offset );
my $now = dclone( $self->_now_ );
open( my $STDOLD, '>&', STDERR );
open( STDERR, '>>', '/dev/null' );
my $now = dclone( $self->_now_ );
open( STDOUT, '>&', $STDOLD );
return $now->subtract_duration($duration);
}

Expand Down

0 comments on commit 290996e

Please sign in to comment.