diff options
| author | fukachan <fukachan> | 2002-08-07 15:06:58 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2002-08-07 15:06:58 +0000 |
| commit | f41d6d36f6bea2cc03747385198aeef4e9bd9b91 (patch) | |
| tree | 0c35db64686b36797a5e4ccc194947846dede8cd /fml/lib/FML/Process | |
| parent | d9d6710a203acd639823cb9d772cd04c0cce39b6 (diff) | |
| download | fml8-f41d6d36f6bea2cc03747385198aeef4e9bd9b91.tar.gz fml8-f41d6d36f6bea2cc03747385198aeef4e9bd9b91.tar.bz2 fml8-f41d6d36f6bea2cc03747385198aeef4e9bd9b91.zip | |
enable automatic user removing (prototype)
Diffstat (limited to 'fml/lib/FML/Process')
| -rw-r--r-- | fml/lib/FML/Process/Error.pm | 42 |
1 files changed, 37 insertions, 5 deletions
diff --git a/fml/lib/FML/Process/Error.pm b/fml/lib/FML/Process/Error.pm index 70629a3e..29b2eb7e 100644 --- a/fml/lib/FML/Process/Error.pm +++ b/fml/lib/FML/Process/Error.pm @@ -3,7 +3,7 @@ # Copyright (C) 2002 Ken'ichi Fukamachi # All rights reserved. # -# $FML: Error.pm,v 1.14 2002/08/03 10:35:08 fukachan Exp $ +# $FML: Error.pm,v 1.15 2002/08/07 04:00:40 fukachan Exp $ # package FML::Process::Error; @@ -161,11 +161,13 @@ sub run Log("bounced: status=$status"); Log("bounced: reason=\"$reason\""); + $curproc->lock('errorcache'); $errorcache->add({ address => $address, status => $status, reason => $reason, }); + $curproc->unlock('errorcache'); $found++; } @@ -173,13 +175,45 @@ sub run }; LogError($@) if $@; - $pcb->set("error", "found", 1) if $found; + if ($found) { + $pcb->set("error", "found", 1); + $curproc->_clean_up_bouncers($args); + } $eval = $config->get_hook( 'error_run_end_hook' ); if ($eval) { eval qq{ $eval; }; LogWarn($@) if $@; } } +# run analyzer() if long time spent after the last analyze. +sub _clean_up_bouncers +{ + my ($curproc, $args) = @_; + my $channel = 'erroranalyzer'; + + if ($curproc->is_timeout($channel)) { + Log("(debug) event timeout"); + + $curproc->lock('errorcache'); + + eval q{ + use FML::Error; + my $error = new FML::Error $curproc; + $error->analyze(); + $error->remove_bouncers(); + }; + LogError($@) if $@; + + $curproc->unlock('errorcache'); + + $curproc->set_timeout($channel, time + 3600); + } + else { + Log("(debug) event not timeout"); + } +} + + =head2 help() show help. @@ -227,9 +261,7 @@ sub finish if ($pcb->get("error", "found")) { Log("error message found"); - - my $scheduler = $curproc->scheduler(); - + # inform ? } else { Log("error message not found"); |
