projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add unset/badnode
[spider.git]
/
perl
/
watchdbg
diff --git
a/perl/watchdbg
b/perl/watchdbg
index 6da3a586a712040d19cff2590ab3c5e85b372009..17bb3289af9f49b58c138cee19805688e759c59e 100755
(executable)
--- a/
perl/watchdbg
+++ b/
perl/watchdbg
@@
-51,7
+51,12
@@
for (;;) {
my @now = Julian::unixtoj(time());
if ($today[1] != $now[1]) {
$fp->close;
my @now = Julian::unixtoj(time());
if ($today[1] != $now[1]) {
$fp->close;
- $fh = $fp->open(@now) or die $!;
+ my $i;
+ for ($i = 0; $i < 20; $i++) {
+ last if $fh = $fp->open(@now);
+ sleep 5;
+ }
+ die $! if $i >= 20;
@today = @now;
}
}
@today = @now;
}
}
@@
-62,8
+67,8
@@
sub printit
my $line = shift;
my @line = split '\^', $line;
my $t = shift @line;
my $line = shift;
my @line = split '\^', $line;
my $t = shift @line;
-
my ($sec,$min,$hour) = gmtime((defined $t) ? $t : time);
-
my $buf = sprintf "%02d:%02d:%02d", $hour, $min, $sec;
+ my ($sec,$min,$hour) = gmtime((defined $t) ? $t : time);
+ my $buf = sprintf "%02d:%02d:%02d", $hour, $min, $sec;
print $buf, ' ', join('^', @line);
}
print $buf, ' ', join('^', @line);
}