From: Tyler Riddle Date: Wed, 3 Oct 2012 17:13:42 +0000 (-0700) Subject: watchdog is now configurable X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a3669b28976dd1f625d56555199a1d1615d4b081;p=scpubgit%2FSystem-Introspector.git watchdog is now configurable --- diff --git a/lib/System/Introspector/Config.pm b/lib/System/Introspector/Config.pm index f5a0199..560cba7 100644 --- a/lib/System/Introspector/Config.pm +++ b/lib/System/Introspector/Config.pm @@ -25,6 +25,8 @@ sub host_logs { $_[0]->config->{host_logs} } sub host_concurrency { $_[0]->config->{host_concurrency} } +sub watchdog_timeout { $_[0]->config->{watchdog_timeout} } + my $_load_host_file = sub { my ($self, $path) = @_; my $full_path = join '/', dirname($self->config_file), $path; diff --git a/lib/System/Introspector/Gatherer.pm b/lib/System/Introspector/Gatherer.pm index a67db62..41efe97 100644 --- a/lib/System/Introspector/Gatherer.pm +++ b/lib/System/Introspector/Gatherer.pm @@ -10,7 +10,7 @@ use System::Introspector::Logger qw( :log :dlog ); has introspectors => (is => 'ro', required => 1); has stderr_fh => ( is => 'ro' ); -has watchdog_timeout => ( is => 'ro', default => sub { 300 } ); +has watchdog_timeout => ( is => 'ro' ); sub gather_all { my ($self) = @_; @@ -64,7 +64,10 @@ sub new_from_spec { my ($user, $host, $sudo_user) = @arg{qw( user host sudo_user )}; my $sudo = defined($sudo_user) ? sprintf('%s@', $sudo_user) : undef; my $args = { introspectors => $arg{introspectors} }; - my %connection_args = ( stderr => $arg{stderr_fh} ); + + Dlog_trace { "Arguments for gatherer object: $_" } $args; + + my %connection_args = ( stderr => $arg{stderr_fh}, watchdog_timeout => $arg{watchdog_timeout} ); if (defined $host) { my $remote = join '@', grep defined, $user, $host; my $conn = Object::Remote::Connection->conn_from_spec($remote, %connection_args); diff --git a/lib/System/Introspector/State.pm b/lib/System/Introspector/State.pm index f2f5f7f..d48d8c7 100644 --- a/lib/System/Introspector/State.pm +++ b/lib/System/Introspector/State.pm @@ -179,6 +179,7 @@ sub _create_gatherer { my $gatherer = System::Introspector::Gatherer->new_from_spec( user => $self->user, stderr_fh => $stderr_fh, + watchdog_timeout => $self->config->watchdog_timeout, host => $arg{host}, sudo_user => $arg{sudo} && $self->sudo_user, introspectors => $arg{introspectors},