X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXCron.pm;fp=perl%2FDXCron.pm;h=9a3aac50495b80716f07a67e7efa93ee921ab04d;hb=ed993b76a84e36b22efd1fc762d6a466497bcf7e;hp=c011d7b3d3e3df0740bfbdc3662edd6646b95d30;hpb=abbcfa7500858a2eba4135b0af5db9f3fca8d68e;p=spider.git diff --git a/perl/DXCron.pm b/perl/DXCron.pm index c011d7b3..9a3aac50 100644 --- a/perl/DXCron.pm +++ b/perl/DXCron.pm @@ -14,7 +14,7 @@ use DXM; use DXDebug; use IO::File; use DXLog; - +use Time::HiRes qw(gettimeofday tv_interval); use Mojo::IOLoop::Subprocess; use strict; @@ -245,11 +245,16 @@ sub start_connect sub spawn { my $line = shift; + my $t0 = [gettimeofday]; dbg("DXCron::spawn: $line") if isdbg("cron"); my $fc = Mojo::IOLoop::Subprocess->new(); $fc->run( - sub {my @res = `$line`; return @res}, + sub { + my @res = `$line`; +# diffms("DXCron spawn 1", $line, $t0, scalar @res) if isdbg('chan'); + return @res + }, sub { my ($fc, $err, @res) = @_; if ($err) { @@ -261,6 +266,7 @@ sub spawn chomp; dbg("DXCron::spawn: $_") if isdbg("cron"); } + diffms("by DXCron::spawn", $line, $t0, scalar @res) if isdbg('chan'); } ); } @@ -268,6 +274,7 @@ sub spawn sub spawn_cmd { my $line = shift; + my $t0 = [gettimeofday]; dbg("DXCron::spawn_cmd run: $line") if isdbg('cron'); my $fc = Mojo::IOLoop::Subprocess->new(); @@ -276,6 +283,7 @@ sub spawn_cmd $main::me->{_nospawn} = 1; my @res = $main::me->run_cmd($line); delete $main::me->{_nospawn}; +# diffms("DXCron spawn_cmd 1", $line, $t0, scalar @res) if isdbg('chan'); return @res; }, sub { @@ -288,6 +296,7 @@ sub spawn_cmd chomp; dbg("DXCron::spawn_cmd: $_") if isdbg("cron"); } + diffms("by DXCron::spawn_cmd", $line, $t0, scalar @res) if isdbg('chan'); } ); }