From 65c05fbbc7c5d9e5ed3f59207ea2ce8ae50bdf7f Mon Sep 17 00:00:00 2001 From: fukachan Date: Sun, 16 Mar 2003 07:26:20 +0000 Subject: clean up lock on error cache. move lock mechanism into only FML::Error module. XXX lock channel name is changed but hard-coded yet now. --- fml/lib/FML/Process/Error.pm | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'fml/lib/FML/Process/Error.pm') diff --git a/fml/lib/FML/Process/Error.pm b/fml/lib/FML/Process/Error.pm index 8ef57ac8..59a23285 100644 --- a/fml/lib/FML/Process/Error.pm +++ b/fml/lib/FML/Process/Error.pm @@ -3,7 +3,7 @@ # Copyright (C) 2002,2003 Ken'ichi Fukamachi # All rights reserved. # -# $FML: Error.pm,v 1.27 2003/02/11 09:48:16 fukachan Exp $ +# $FML: Error.pm,v 1.28 2003/02/18 15:57:46 fukachan Exp $ # package FML::Process::Error; @@ -153,8 +153,8 @@ sub run $bouncer->analyze( $msg ); use FML::Error; - my $error_obj = new FML::Error $curproc; - my $errorcache = $error_obj->db_open(); + my $error = new FML::Error $curproc; + $error->db_open(); for my $address ( $bouncer->address_list ) { my $status = $bouncer->status( $address ); @@ -165,17 +165,17 @@ sub run Log("bounced: status=$status"); Log("bounced: reason=\"$reason\""); - $curproc->lock('errorcache'); - $errorcache->add({ + $error->add({ address => $address, status => $status, reason => $reason, }); - $curproc->unlock('errorcache'); $found++; } } + + $error->db_close(); }; LogError($@) if $@; @@ -206,11 +206,7 @@ sub _clean_up_bouncers eval q{ use FML::Error; my $error = new FML::Error $curproc; - - $curproc->lock('errorcache'); $error->analyze(); - $curproc->unlock('errorcache'); - $error->remove_bouncers(); }; LogError($@) if $@; -- cgit v1.2.1