changeset 1648:d9077dcd38e1

fix antispam polling moinmaster on every save
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 31 Oct 2006 21:58:36 +0100
parents c0cb0884f7ec
children 65d05bbcd436
files MoinMoin/security/antispam.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/security/antispam.py	Tue Oct 31 21:57:48 2006 +0100
+++ b/MoinMoin/security/antispam.py	Tue Oct 31 21:58:36 2006 +0100
@@ -76,7 +76,7 @@
     p = PageEditor(request, pagename, uid_override="Antispam subsystem")
     invalidate_cache = False
     if do_update:
-        tooold = time.time() - 3600
+        tooold = time.time() - 1800
         mymtime = wikiutil.version2timestamp(p.mtime_usecs())
         failure = caching.CacheEntry(request, "antispam", "failure", scope='wiki')
         fail_time = failure.mtime() # only update if no failure in last hour
@@ -127,6 +127,10 @@
                         raise WikirpcError("failed to get BadContent data",
                                            response)
                     p._write_file(response)
+                else:
+                    failure.update("") # we didn't get a modified version, this avoids
+                                       # permanent polling for every save when there
+                                       # is no updated master page
 
                 invalidate_cache = True