projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
put dx.pl into an explicit handle sub
[spider.git]
/
perl
/
DXCron.pm
diff --git
a/perl/DXCron.pm
b/perl/DXCron.pm
index 0cc6ce88d85ec36e7fa8617627fb724f41d9bb68..c011d7b3d3e3df0740bfbdc3662edd6646b95d30 100644
(file)
--- a/
perl/DXCron.pm
+++ b/
perl/DXCron.pm
@@
-62,7
+62,7
@@
sub cread
my $line = 0;
my @out;
my $line = 0;
my @out;
- dbg("
cron:
reading $fn\n") if isdbg('cron');
+ dbg("
DXCron::cread
reading $fn\n") if isdbg('cron');
open($fh, $fn) or confess("cron: can't open $fn $!");
while (<$fh>) {
$line++;
open($fh, $fn) or confess("cron: can't open $fn $!");
while (<$fh>) {
$line++;
@@
-81,9
+81,9
@@
sub cread
if (!$err) {
$ref->{cmd} = $cmd;
push @out, $ref;
if (!$err) {
$ref->{cmd} = $cmd;
push @out, $ref;
- dbg("
cron
: adding $_\n") if isdbg('cron');
+ dbg("
DXCron::cread
: adding $_\n") if isdbg('cron');
} else {
} else {
- dbg("
cron
: error on line $line '$_'\n") if isdbg('cron');
+ dbg("
DXCron::cread
: error on line $line '$_'\n") if isdbg('cron');
}
}
close($fh);
}
}
close($fh);
@@
-246,6
+246,7
@@
sub spawn
{
my $line = shift;
{
my $line = shift;
+ dbg("DXCron::spawn: $line") if isdbg("cron");
my $fc = Mojo::IOLoop::Subprocess->new();
$fc->run(
sub {my @res = `$line`; return @res},
my $fc = Mojo::IOLoop::Subprocess->new();
$fc->run(
sub {my @res = `$line`; return @res},
@@
-268,7
+269,7
@@
sub spawn_cmd
{
my $line = shift;
{
my $line = shift;
- dbg("spawn_cmd run: $line") if isdbg('cron');
+ dbg("
DXCron::
spawn_cmd run: $line") if isdbg('cron');
my $fc = Mojo::IOLoop::Subprocess->new();
$fc->run(
sub {
my $fc = Mojo::IOLoop::Subprocess->new();
$fc->run(
sub {
@@
-280,12
+281,12
@@
sub spawn_cmd
sub {
my ($fc, $err, @res) = @_;
if ($err) {
sub {
my ($fc, $err, @res) = @_;
if ($err) {
- my $s = "spawn_cmd: error $err";
+ my $s = "
DXCron::
spawn_cmd: error $err";
dbg($s);
}
for (@res) {
chomp;
dbg($s);
}
for (@res) {
chomp;
- dbg("spawn_cmd: $_") if isdbg("cron");
+ dbg("
DXCron::
spawn_cmd: $_") if isdbg("cron");
}
}
);
}
}
);
@@
-309,10
+310,10
@@
sub run_cmd
{
my $line = shift;
my @in = $main::me->run_cmd($line);
{
my $line = shift;
my @in = $main::me->run_cmd($line);
- dbg("
cmd run
: $line") if isdbg('cron');
+ dbg("
DXCron::run_cmd
: $line") if isdbg('cron');
for (@in) {
s/\s*$//og;
for (@in) {
s/\s*$//og;
- dbg("cmd out: $_") if isdbg('cron');
+ dbg("
DXCron::
cmd out: $_") if isdbg('cron');
}
}
}
}