You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by fe...@apache.org on 2004/11/27 01:12:17 UTC
svn commit: r106673 - /spamassassin/trunk/lib/Mail/SpamAssassin.pm /spamassassin/trunk/lib/Mail/SpamAssassin/Bayes.pm
Author: felicity
Date: Fri Nov 26 16:12:15 2004
New Revision: 106673
URL: http://svn.apache.org/viewcvs?view=rev&rev=106673
Log:
bug 3986: add opportunistic_expire_check_only option to init_learn() to specify that the opportunistic function call should only deal with journal sync, and not db expiry -- but mark whether or not expiry is due. this can then be used by a calling function to do the expiry post-process.
Modified:
spamassassin/trunk/lib/Mail/SpamAssassin.pm
spamassassin/trunk/lib/Mail/SpamAssassin/Bayes.pm
Modified: spamassassin/trunk/lib/Mail/SpamAssassin.pm
Url: http://svn.apache.org/viewcvs/spamassassin/trunk/lib/Mail/SpamAssassin.pm?view=diff&rev=106673&p1=spamassassin/trunk/lib/Mail/SpamAssassin.pm&r1=106672&p2=spamassassin/trunk/lib/Mail/SpamAssassin.pm&r2=106673
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin.pm Fri Nov 26 16:12:15 2004
@@ -468,6 +468,11 @@
Whether or not to wait a long time for locks to complete (optional, default 0).
+=item opportunistic_expire_check_only
+
+During the opportunistic journal sync and expire check, don't actually do the
+expire but report back whether or not it should occur (optional, default 0).
+
=back
=cut
@@ -485,6 +490,7 @@
if (defined $opts->{learn_to_journal}) { $self->{learn_to_journal} = $opts->{learn_to_journal}; }
if (defined $opts->{caller_will_untie}) { $self->{learn_caller_will_untie} = $opts->{caller_will_untie}; }
if (defined $opts->{wait_for_lock}) { $self->{learn_wait_for_lock} = $opts->{wait_for_lock}; }
+ if (defined $opts->{opportunistic_expire_check_only}) { $self->{opportunistic_expire_check_only} = $opts->{opportunistic_expire_check_only}; }
1;
}
Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Bayes.pm
Url: http://svn.apache.org/viewcvs/spamassassin/trunk/lib/Mail/SpamAssassin/Bayes.pm?view=diff&rev=106673&p1=spamassassin/trunk/lib/Mail/SpamAssassin/Bayes.pm&r1=106672&p2=spamassassin/trunk/lib/Mail/SpamAssassin/Bayes.pm&r2=106673
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Bayes.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Bayes.pm Fri Nov 26 16:12:15 2004
@@ -1317,7 +1317,15 @@
}
# Take any opportunistic actions we can take
- $self->opportunistic_calls();
+ if ($self->{main}->{opportunistic_expire_check_only}) {
+ # we're supposed to report on expiry only -- so do the
+ # opportunistic_calls() run for the journal only.
+ $self->opportunistic_calls(1);
+ $permsgstatus->{bayes_expiry_due} = $self->{store}->expiry_due();
+ }
+ else {
+ $self->opportunistic_calls();
+ }
# Do any cleanup we need to do
$self->{store}->cleanup();