diff options
| author | fukachan <fukachan> | 2001-11-18 06:42:17 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2001-11-18 06:42:17 +0000 |
| commit | 2102faeb7c7a7b5ac8855d1a604afcc04f4d6f3b (patch) | |
| tree | 2e15baaec51847485eeca7fc639fc12b54c1948b /fml/lib/FML/Process/ThreadTrack.pm | |
| parent | 838c04b6eaba4b50b8eb153cf3d6751753d2162d (diff) | |
| download | fml8-2102faeb7c7a7b5ac8855d1a604afcc04f4d6f3b.tar.gz fml8-2102faeb7c7a7b5ac8855d1a604afcc04f4d6f3b.tar.bz2 fml8-2102faeb7c7a7b5ac8855d1a604afcc04f4d6f3b.zip | |
change max_id speculation strategy:
1. check the max_id is given or not, use it if given
2. try max_id() of FML::Article;
3. speculate_max_id($spool_dir) in FML::Article
Diffstat (limited to 'fml/lib/FML/Process/ThreadTrack.pm')
| -rw-r--r-- | fml/lib/FML/Process/ThreadTrack.pm | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/fml/lib/FML/Process/ThreadTrack.pm b/fml/lib/FML/Process/ThreadTrack.pm index 6442d0c9..c7742383 100644 --- a/fml/lib/FML/Process/ThreadTrack.pm +++ b/fml/lib/FML/Process/ThreadTrack.pm @@ -4,7 +4,7 @@ # Copyright (C) 2000-2001 Ken'ichi Fukamachi # All rights reserved. # -# $FML: ThreadTrack.pm,v 1.11 2001/11/09 13:23:15 fukachan Exp $ +# $FML: ThreadTrack.pm,v 1.12 2001/11/11 13:37:41 fukachan Exp $ # package FML::Process::ThreadTrack; @@ -84,8 +84,7 @@ sub run my $ml_name = $config->{ ml_name }; my $thread_db_dir = $config->{ thread_db_dir }; my $spool_dir = $mydir || $config->{ spool_dir }; - my $max_id = defined $options->{ article_id_max } ? - $options->{ article_id_max } : $curproc->article_id_max(); + my $max_id = $curproc->_speculate_max_id($spool_dir); my $ttargs = { myname => $myname, logfp => \&Log, @@ -140,6 +139,41 @@ sub run } +sub _speculate_max_id +{ + my ($curproc, $spool_dir) = @_; + my $options = $curproc->command_line_options(); + + if (defined $options->{ article_id_max }) { + return $options->{ article_id_max }; + } + else { + my $max_id = $curproc->speculate_max_id(); + + # XXX check whether $max_id > 1 or not since + # XXX speculate_max_id() returns 1 by default + if ($max_id > 1) { + return $max_id; + } + else { + eval q{ + use FML::Article; + push(@ISA, 'FML::Article'); + $max_id = $curproc->speculate_max_id($spool_dir); + }; + warn($@) if $@; + } + + if ($max_id > 0) { + return $max_id; + } + } + + warn("cannot determine max_id"); + return undef; +} + + sub _read_filter_list { my ($thread, $file) = @_; |
