From: Andy Grundman Date: Thu, 14 Dec 2006 16:31:25 +0000 (+0000) Subject: Fix Restarter::Watcher to support delay of 0 X-Git-Tag: 5.7099_04~253 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=951572c08d33e8364f5cc49286f144015b80b5f9 Fix Restarter::Watcher to support delay of 0 --- diff --git a/Changes b/Changes index 87aa118..e79992e 100644 --- a/Changes +++ b/Changes @@ -4,6 +4,7 @@ This file documents the revision history for Perl extension Catalyst. - allow mutation of body() in Catalyst::Request - Don't ignore file uploads if form contains a text field with the same name. (Carl Franks) + - Support restart_delay of 0 (for use in the POE engine). - ... 5.7006 2006-11-03 14.18 diff --git a/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm b/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm index 3062dc6..c013450 100644 --- a/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm +++ b/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm @@ -47,8 +47,10 @@ sub watch { my @changes; my @changed_files; + + my $delay = ( defined $self->delay ) ? $self->delay : 1; - sleep $self->delay || 1; + sleep $delay if $delay > 0; eval { @changes = $self->modified->changed }; if ($@) {