diff options
| author | fukachan <fukachan> | 2006-05-03 07:42:37 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2006-05-03 07:42:37 +0000 |
| commit | baaa69787697aafd584d93741a35881bfc0858c5 (patch) | |
| tree | f985f25496ab3d8f59c5ba3edd8642fe01292b88 /fml/lib/FML/Process | |
| parent | 367bf6076db0b243b4238183270962b8b78f6660 (diff) | |
| download | fml8-baaa69787697aafd584d93741a35881bfc0858c5.tar.gz fml8-baaa69787697aafd584d93741a35881bfc0858c5.tar.bz2 fml8-baaa69787697aafd584d93741a35881bfc0858c5.zip | |
try to expire articles once per day if enabled.
Diffstat (limited to 'fml/lib/FML/Process')
| -rw-r--r-- | fml/lib/FML/Process/Distribute.pm | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/fml/lib/FML/Process/Distribute.pm b/fml/lib/FML/Process/Distribute.pm index bad25eb3..de711a92 100644 --- a/fml/lib/FML/Process/Distribute.pm +++ b/fml/lib/FML/Process/Distribute.pm @@ -3,7 +3,7 @@ # Copyright (C) 2000,2001,2002,2003,2004,2005,2006 Ken'ichi Fukamachi # All rights reserved. # -# $FML: Distribute.pm,v 1.175 2006/04/11 12:08:20 fukachan Exp $ +# $FML: Distribute.pm,v 1.176 2006/04/11 12:31:43 fukachan Exp $ # package FML::Process::Distribute; @@ -368,6 +368,8 @@ sub finish $curproc->logwarn("queue remains due to MTA fatal error."); } + $curproc->_expire_article(); + $eval = $config->get_hook( 'distribute_finish_end_hook' ); $eval .= $config->get_hook( 'article_post_finish_end_hook' ); if ($eval) { eval qq{ $eval; }; $curproc->logwarn($@) if $@; } @@ -816,6 +818,25 @@ sub _htmlify } +# Descriptions: try to expire articles. +# Arguments: OBJ($curproc) +# Side Effects: none +# Return Value: none +sub _expire_article +{ + my ($curproc) = @_; + + my $event_channel = "article_expire"; + if ($curproc->is_event_timeout($event_channel)) { + $curproc->logdebug("try to expire articles"); + + my $article = new FML::Article $curproc; + $article->expire(); + $curproc->event_set_timeout($event_channel, time + 24*3600); + } +} + + =head1 CODING STYLE See C<http://www.fml.org/software/FNF/> on fml coding style guide. |
