diff options
| author | fukachan <fukachan> | 2006-02-05 01:01:55 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2006-02-05 01:01:55 +0000 |
| commit | fbdf5a8effb2524dffc3b52f65c6d0921997fa66 (patch) | |
| tree | 9c1b63f617845ac84b21e636c6fc4d8df0efcf0b /fml | |
| parent | 2ea02bb5d31caf1f6ea347eb7b94e7cf9ce52687 (diff) | |
| download | fml8-fbdf5a8effb2524dffc3b52f65c6d0921997fa66.tar.gz fml8-fbdf5a8effb2524dffc3b52f65c6d0921997fa66.tar.bz2 fml8-fbdf5a8effb2524dffc3b52f65c6d0921997fa66.zip | |
implement raw level insert_message_id_cache() method to access
cache more directly.
rewritten to use it.
Diffstat (limited to 'fml')
| -rw-r--r-- | fml/lib/FML/Header.pm | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/fml/lib/FML/Header.pm b/fml/lib/FML/Header.pm index 30df6eeb..b6b1694e 100644 --- a/fml/lib/FML/Header.pm +++ b/fml/lib/FML/Header.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: Header.pm,v 1.87 2006/01/09 14:08:07 fukachan Exp $ +# $FML: Header.pm,v 1.88 2006/02/03 11:06:50 fukachan Exp $ # package FML::Header; @@ -834,14 +834,29 @@ sub _update_xxx_message_id_cache $mid = $header->address_cleanup($mid); if ($mid) { - use FML::Header::MessageID; - my $xargs = { directory => $dir }; - my $db = FML::Header::MessageID->new->db_open($xargs); + $header->insert_message_id_cache($config, $mid, $dir); + } +} - if (defined $db) { - # save the current id and time (unix time). - $db->{ $mid } = time; - } + +# Descriptions: raw level routine to update message id cache. +# use $message_id_cache_dir as the cache dir +# if $dir argument not specified. +# Arguments: OBJ($header) OBJ($config) STR($mid) STR($dir) +# Side Effects: update cache +# Return Value: none +sub insert_message_id_cache +{ + my ($header, $config, $mid, $dir) = @_; + my $cache_dir = $dir || $config->{ 'message_id_cache_dir' }; + + use FML::Header::MessageID; + my $xargs = { directory => $cache_dir }; + my $db = FML::Header::MessageID->new->db_open($xargs); + + if (defined $db) { + # save the current id and time (unix time). + $db->{ $mid } = time; } } |
