make sure DXCron::spawn records output
authorDirk Koopman <djk@tobit.co.uk>
Fri, 25 Mar 2016 22:57:47 +0000 (22:57 +0000)
committerDirk Koopman <djk@tobit.co.uk>
Fri, 25 Mar 2016 22:57:47 +0000 (22:57 +0000)
perl/DXCron.pm

index e90865f385d989217b459494bf3b47644504ddc5..f9a4f07ea12585ab62b30389b1c4734d341fa2eb 100644 (file)
@@ -247,7 +247,7 @@ sub spawn
        my $fc = Mojo::IOLoop::ForkCall->new;
        $fc->run(
                         sub {my @res = `$line`; return @res},
-                        undef,
+                        [],
                         sub {
                                 my ($fc, $err, @res) = @_; 
                                 if (defined $err) {
@@ -255,7 +255,10 @@ sub spawn
                                         dbg($s);
                                         return;
                                 }
-                                dbg("DXCron::spawn: $_") for @res;
+                                for (@res) {
+                                        chomp;
+                                        dbg("DXCron::spawn: $_") if isdbg("cron");
+                                }
                         }
                        );
 }