projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altered wcy display a bit
[spider.git]
/
perl
/
DXCron.pm
diff --git
a/perl/DXCron.pm
b/perl/DXCron.pm
index 507a6a12a81053d9de0e6f136da6381beb73cce6..8fb0f4664489609be8a6f3f56c584d6b6956d1fd 100644
(file)
--- a/
perl/DXCron.pm
+++ b/
perl/DXCron.pm
@@
-12,8
+12,7
@@
use DXVars;
use DXUtil;
use DXM;
use DXDebug;
use DXUtil;
use DXM;
use DXDebug;
-use FileHandle;
-use Carp;
+use IO::File;
use strict;
use strict;
@@
-58,7
+57,7
@@
sub init
sub cread
{
my $fn = shift;
sub cread
{
my $fn = shift;
- my $fh = new
FileHand
le;
+ my $fh = new
IO::Fi
le;
my $line = 0;
dbg('cron', "cron: reading $fn\n");
my $line = 0;
dbg('cron', "cron: reading $fn\n");
@@
-234,6
+233,11
@@
sub start_connect
my $call = uc shift;
my $lccall = lc $call;
my $call = uc shift;
my $lccall = lc $call;
+ if (grep {$_->{call} eq $call} @main::outstanding_connects) {
+ dbg('cron', "Connect not started, outstanding connect to $call");
+ return;
+ }
+
my $prog = "$main::root/local/client.pl";
$prog = "$main::root/perl/client.pl" if ! -e $prog;
my $prog = "$main::root/local/client.pl";
$prog = "$main::root/perl/client.pl" if ! -e $prog;
@@
-247,8
+251,7
@@
sub start_connect
alarm(0);
DXChannel::closeall();
$SIG{CHLD} = $SIG{TERM} = $SIG{INT} = $SIG{__WARN__} = 'DEFAULT';
alarm(0);
DXChannel::closeall();
$SIG{CHLD} = $SIG{TERM} = $SIG{INT} = $SIG{__WARN__} = 'DEFAULT';
- exec $prog, $call, 'connect';
- dbg('cron', "exec '$prog' failed $!");
+ exec $prog, $call, 'connect' or dbg('cron', "exec '$prog' failed $!");
}
dbg('cron', "connect to $call started");
} else {
}
dbg('cron', "connect to $call started");
} else {
@@
-274,8
+277,7
@@
sub spawn
alarm(0);
DXChannel::closeall();
$SIG{CHLD} = $SIG{TERM} = $SIG{INT} = $SIG{__WARN__} = 'DEFAULT';
alarm(0);
DXChannel::closeall();
$SIG{CHLD} = $SIG{TERM} = $SIG{INT} = $SIG{__WARN__} = 'DEFAULT';
- exec "$line";
- dbg('cron', "exec '$line' failed $!");
+ exec "$line" or dbg('cron', "exec '$line' failed $!");
}
dbg('cron', "spawn of $line started");
} else {
}
dbg('cron', "spawn of $line started");
} else {
@@
-297,7
+299,7
@@
sub rcmd
return if !$noderef || !$noderef->pcversion;
# send it
return if !$noderef || !$noderef->pcversion;
# send it
- DXProt::addrcmd($
main::mycall
, $call, $line);
+ DXProt::addrcmd($
DXProt::me
, $call, $line);
}
1;
__END__
}
1;
__END__