projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix DXCron, lockout and close_gracefully
[spider.git]
/
perl
/
Timer.pm
diff --git
a/perl/Timer.pm
b/perl/Timer.pm
index fb429f643537d40cd204b367c93ed5f962cd74df..e0f760b857a576708c60a01d9fe74a6a58b0a73f 100644
(file)
--- a/
perl/Timer.pm
+++ b/
perl/Timer.pm
@@
-23,11
+23,11
@@
sub new
my ($pkg, $time, $proc, $recur) = @_;
my $obj = ref($pkg);
my $class = $obj || $pkg;
my ($pkg, $time, $proc, $recur) = @_;
my $obj = ref($pkg);
my $class = $obj || $pkg;
- my $self = bless { t=>$time + time, proc=>$proc }, $class;
+ my $self = bless { t=>$time +
$main::sys
time, proc=>$proc }, $class;
$self->{interval} = $time if $recur;
push @timerchain, $self;
$self->{interval} = $time if $recur;
push @timerchain, $self;
- $notimers
++
;
- dbg("Timer created ($notimers)") if isdbg('connll');
+ $notimers
= @timerchain
;
+ dbg("Timer created (
notimers:
$notimers)") if isdbg('connll');
return $self;
}
return $self;
}
@@
-36,11
+36,13
@@
sub del
my $self = shift;
delete $self->{proc};
@timerchain = grep {$_ != $self} @timerchain;
my $self = shift;
delete $self->{proc};
@timerchain = grep {$_ != $self} @timerchain;
+ $notimers = @timerchain;
+ dbg("Timer deleted (notimers: $notimers)") if isdbg('connll');
}
sub handler
{
}
sub handler
{
- my $now = time;
+ my $now =
$main::sys
time;
return unless $now != $lasttime;
return unless $now != $lasttime;
@@
-59,6
+61,5
@@
sub handler
sub DESTROY
{
dbg("timer destroyed ($Timer::notimers)") if isdbg('connll');
sub DESTROY
{
dbg("timer destroyed ($Timer::notimers)") if isdbg('connll');
- $Timer::notimers--;
}
1;
}
1;