Fix Restarter::Watcher to support delay of 0
Andy Grundman [Thu, 14 Dec 2006 16:31:25 +0000 (16:31 +0000)]
Changes
lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm

diff --git a/Changes b/Changes
index 87aa118..e79992e 100644 (file)
--- 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
index 3062dc6..c013450 100644 (file)
@@ -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 ($@) {