spamassassin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j.@apache.org
Subject svn commit: r602899 - in /spamassassin/branches/bug-5293-pluginized-bayes/lib/Mail: SpamAssassin.pm SpamAssassin/Bayes.pm SpamAssassin/PerMsgStatus.pm SpamAssassin/Plugin/Bayes.pm SpamAssassin/Plugin/OSBF.pm
Date Mon, 10 Dec 2007 13:37:05 GMT
Author: jm
Date: Mon Dec 10 05:37:04 2007
New Revision: 602899

URL: http://svn.apache.org/viewvc?rev=602899&view=rev
Log:
rename 'sanity_check_bayes_is_untied' to 'learner_close', which more closely matches what
it actually does; it's just in the Bayes impl that it's used as a sanity check.  Do same with
the Mail::SA::Bayes API

Modified:
    spamassassin/branches/bug-5293-pluginized-bayes/lib/Mail/SpamAssassin.pm
    spamassassin/branches/bug-5293-pluginized-bayes/lib/Mail/SpamAssassin/Bayes.pm
    spamassassin/branches/bug-5293-pluginized-bayes/lib/Mail/SpamAssassin/PerMsgStatus.pm
    spamassassin/branches/bug-5293-pluginized-bayes/lib/Mail/SpamAssassin/Plugin/Bayes.pm
    spamassassin/branches/bug-5293-pluginized-bayes/lib/Mail/SpamAssassin/Plugin/OSBF.pm

Modified: spamassassin/branches/bug-5293-pluginized-bayes/lib/Mail/SpamAssassin.pm
URL: http://svn.apache.org/viewvc/spamassassin/branches/bug-5293-pluginized-bayes/lib/Mail/SpamAssassin.pm?rev=602899&r1=602898&r2=602899&view=diff
==============================================================================
--- spamassassin/branches/bug-5293-pluginized-bayes/lib/Mail/SpamAssassin.pm (original)
+++ spamassassin/branches/bug-5293-pluginized-bayes/lib/Mail/SpamAssassin.pm Mon Dec 10 05:37:04
2007
@@ -671,7 +671,7 @@
 
 sub finish_learner {
   my $self = shift;
-  $self->{bayes_scanner}->sanity_check_is_untied(1) if $self->{bayes_scanner};
+  $self->{bayes_scanner}->force_close(1) if $self->{bayes_scanner};
   1;
 }
 
@@ -1325,7 +1325,7 @@
   }
 
   # make sure things are ready for scanning
-  $self->{bayes_scanner}->sanity_check_is_untied() if $self->{bayes_scanner};
+  $self->{bayes_scanner}->force_close() if $self->{bayes_scanner};
   $self->call_plugins("compile_now_finish",
 		      { use_user_prefs => $use_user_prefs,
 			keep_userstate => $deal_with_userstate});

Modified: spamassassin/branches/bug-5293-pluginized-bayes/lib/Mail/SpamAssassin/Bayes.pm
URL: http://svn.apache.org/viewvc/spamassassin/branches/bug-5293-pluginized-bayes/lib/Mail/SpamAssassin/Bayes.pm?rev=602899&r1=602898&r2=602899&view=diff
==============================================================================
--- spamassassin/branches/bug-5293-pluginized-bayes/lib/Mail/SpamAssassin/Bayes.pm (original)
+++ spamassassin/branches/bug-5293-pluginized-bayes/lib/Mail/SpamAssassin/Bayes.pm Mon Dec
10 05:37:04 2007
@@ -73,10 +73,14 @@
 
 ###########################################################################
 
-sub sanity_check_is_untied {
+# force the Bayes dbs to be closed, if they haven't already been; called
+# at the end of scan operation, or when switching between user IDs,
+# or when C<Mail::SpamAssassin::finish_learner()> is called.
+#
+sub force_close {
   my $self = shift;
   my $quiet = shift;
-  $self->{main}->call_plugins("sanity_check_bayes_is_untied", { quiet => $quiet
});
+  $self->{main}->call_plugins("learner_close", { quiet => $quiet });
 }
 
 ###########################################################################

Modified: spamassassin/branches/bug-5293-pluginized-bayes/lib/Mail/SpamAssassin/PerMsgStatus.pm
URL: http://svn.apache.org/viewvc/spamassassin/branches/bug-5293-pluginized-bayes/lib/Mail/SpamAssassin/PerMsgStatus.pm?rev=602899&r1=602898&r2=602899&view=diff
==============================================================================
--- spamassassin/branches/bug-5293-pluginized-bayes/lib/Mail/SpamAssassin/PerMsgStatus.pm
(original)
+++ spamassassin/branches/bug-5293-pluginized-bayes/lib/Mail/SpamAssassin/PerMsgStatus.pm
Mon Dec 10 05:37:04 2007
@@ -244,7 +244,7 @@
     $self->{main}->finish_learner();        # for now
 
     if (exists $self->{main}->{bayes_scanner}) {
-      $self->{main}->{bayes_scanner}->sanity_check_is_untied();
+      $self->{main}->{bayes_scanner}->force_close();
     }
     1;
   } or do {

Modified: spamassassin/branches/bug-5293-pluginized-bayes/lib/Mail/SpamAssassin/Plugin/Bayes.pm
URL: http://svn.apache.org/viewvc/spamassassin/branches/bug-5293-pluginized-bayes/lib/Mail/SpamAssassin/Plugin/Bayes.pm?rev=602899&r1=602898&r2=602899&view=diff
==============================================================================
--- spamassassin/branches/bug-5293-pluginized-bayes/lib/Mail/SpamAssassin/Plugin/Bayes.pm
(original)
+++ spamassassin/branches/bug-5293-pluginized-bayes/lib/Mail/SpamAssassin/Plugin/Bayes.pm
Mon Dec 10 05:37:04 2007
@@ -294,7 +294,7 @@
 ###########################################################################
 
 # Plugin hook.
-sub sanity_check_bayes_is_untied {
+sub learner_close {
   my ($self, $params) = @_;
   my $quiet = $params->{quiet};
 

Modified: spamassassin/branches/bug-5293-pluginized-bayes/lib/Mail/SpamAssassin/Plugin/OSBF.pm
URL: http://svn.apache.org/viewvc/spamassassin/branches/bug-5293-pluginized-bayes/lib/Mail/SpamAssassin/Plugin/OSBF.pm?rev=602899&r1=602898&r2=602899&view=diff
==============================================================================
--- spamassassin/branches/bug-5293-pluginized-bayes/lib/Mail/SpamAssassin/Plugin/OSBF.pm (original)
+++ spamassassin/branches/bug-5293-pluginized-bayes/lib/Mail/SpamAssassin/Plugin/OSBF.pm Mon
Dec 10 05:37:04 2007
@@ -252,17 +252,9 @@
 ###########################################################################
 
 # Plugin hook.
-sub sanity_check_bayes_is_untied {
+sub learner_close {
   my ($self, $params) = @_;
-  my $quiet = $params->{quiet};
-
-  # do a sanity check here.  Wierd things happen if we remain tied
-  # after compiling; for example, spamd will never see that the
-  # number of messages has reached the bayes-scanning threshold.
-  if ($self->{store}->db_readable()) {
-    warn "osbf: oops! still tied to bayes DBs, untying\n" unless $quiet;
-    $self->{store}->untie_db();
-  }
+  if ($self->{store}->db_readable()) { $self->{store}->untie_db(); }
 }
 
 ###########################################################################



Mime
View raw message