You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by he...@apache.org on 2013/05/31 17:55:46 UTC

svn commit: r1488285 - /spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/Redis.pm

Author: hege
Date: Fri May 31 15:55:46 2013
New Revision: 1488285

URL: http://svn.apache.org/r1488285
Log:
Bug 6942: Fix things when bayes_auto_expire not set


Modified:
    spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/Redis.pm

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/Redis.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/Redis.pm?rev=1488285&r1=1488284&r2=1488285&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/Redis.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/Redis.pm Fri May 31 15:55:46 2013
@@ -722,6 +722,8 @@ if the existing token atime is < C<$atim
 sub tok_touch_all {
   my($self, $tokens, $newatime) = @_;
 
+  return 1 unless defined $self->{expire_token};
+
   # We just refresh TTL on all
   foreach (@$tokens) {
     $self->_expire_p("t:$_", $self->{expire_token});
@@ -1177,7 +1179,9 @@ sub _del_p {
 sub _expire_p {
   my ($self, $key, $expire) = @_;
 
-  $self->{redis}->expire($key, $expire, sub {});
+  if (defined $expire) {
+    $self->{redis}->expire($key, $expire, sub {});
+  }
 
   return 1;
 }