diff options
| author | fukachan <fukachan> | 2004-01-01 08:44:48 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2004-01-01 08:44:48 +0000 |
| commit | 399ccc17268eb7506744f34d1c0b0cc6518bafa7 (patch) | |
| tree | 36444f579af1ebcd753e80f6625f1eff3b3b25bf /fml/lib/FML/Error/Cache.pm | |
| parent | a087923f9f568d39f47415027aa775e5a3dcdb68 (diff) | |
| download | fml8-399ccc17268eb7506744f34d1c0b0cc6518bafa7.tar.gz fml8-399ccc17268eb7506744f34d1c0b0cc6518bafa7.tar.bz2 fml8-399ccc17268eb7506744f34d1c0b0cc6518bafa7.zip | |
update/fix comments.
use more proper local variable names.
Diffstat (limited to 'fml/lib/FML/Error/Cache.pm')
| -rw-r--r-- | fml/lib/FML/Error/Cache.pm | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/fml/lib/FML/Error/Cache.pm b/fml/lib/FML/Error/Cache.pm index 0abab348..e93feea2 100644 --- a/fml/lib/FML/Error/Cache.pm +++ b/fml/lib/FML/Error/Cache.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Cache.pm,v 1.14 2003/08/29 15:34:03 fukachan Exp $ +# $FML: Cache.pm,v 1.15 2003/10/15 01:03:31 fukachan Exp $ # package FML::Error::Cache; @@ -40,6 +40,8 @@ where C<$bounce_info) follows: =head2 new() +standard constructor. + =cut @@ -138,10 +140,12 @@ sub add $reason =~ s/\s+/_/g; } else { - $curproc->logerror("FML::Error::Cache: add: not implemented \$argv type"); + my $s = "FML::Error::Cache: unknown type: \$argv"; + $curproc->logerror($s); return undef; } + # XXX-TODO: validate $address ? if ($address) { $db->{ $address } = "$unixtime status=$status reason=$reason"; } @@ -177,6 +181,7 @@ sub delete my $db = $self->{ _db }; if (defined $db) { + # XXX-TODO: validate $address ? if ($address) { delete $db->{ $address }; } @@ -208,10 +213,10 @@ following a set of key ($address) and value. # Descriptions: open the cache database for File::CacheDir. # Arguments: OBJ($self) # Side Effects: none -# Return Value: OBJ +# Return Value: HASH_REF sub _open_cache { - my ($self) = @_; + my ($self) = @_; my $curproc = $self->{ _curproc }; my $config = $curproc->config(); my $type = $config->{ error_analyzer_cache_type }; @@ -221,6 +226,7 @@ sub _open_cache use Tie::JournaledDir; + # XXX-TODO: use ? $type, $mode, $days # tie style my %db = (); tie %db, 'Tie::JournaledDir', { dir => $dir }; @@ -235,7 +241,7 @@ sub _open_cache sub _close_cache { my ($self) = @_; - my $db = $self->{ _db }; + my $db = $self->{ _db }; if (defined $db) { untie %$db; @@ -277,10 +283,10 @@ sub get_primary_keys # Return Value: HASH_REF sub get_all_values_as_hash_ref { - my ($self) = @_; + my ($self) = @_; my $curproc = $self->{ _curproc }; my $config = $curproc->config(); - my $dir = $config->{ error_analyzer_cache_dir }; + my $dir = $config->{ error_analyzer_cache_dir }; use Tie::JournaledDir; my $obj = new Tie::JournaledDir { dir => $dir }; |
