Description
The Antispam feature is supposed to update only once an hour (unless there has been a failure, in which case it should update 1h after the last failure).
However, it updates every save causing:
- large save times (over 65% of the save time is used up by the antispam update)
larger than required load on the moinmaster.wikiwikiweb.de server
Steps to reproduce
Simply save a page to trigger the antispam feature.
Example
Details
MoinMoin Version |
any |
OS and Version |
Linux |
Python Version |
2.3 |
Server Setup |
apache + ModPy |
Server Details |
CentOS 4.0 |
Language you are using the wiki in (set in the browser/UserPreferences) |
English |
Workaround
None.
Discussion
The implemenation (looking in the 1.6 codebase) can not work as is, since it compares the last edit time of the page (p.mtime_usecs()) to the current time. However, if the page does not update, the last edit time of the page will always be older than 1h, always triggering the condition.
One way to solve the problem would be to add fake saves, something along these lines:
diff -r b2322cdabd8a MoinMoin/security/antispam.py --- a/MoinMoin/security/antispam.py Tue Oct 03 15:32:55 2006 +0200 +++ b/MoinMoin/security/antispam.py Thu Oct 12 14:57:09 2006 -0400 @@ -127,6 +127,8 @@ def getblacklist(request, pagename, do_u raise WikirpcError("failed to get BadContent data", response) p._write_file(response) + else: + p._write_file(None, action='TOUCH') invalidate_cache = True
Obviously, _write_file() would need to be modified to support the 'TOUCH' action, but that shouldn't be very difficult.
I think a much simpler solution would be to consider a non-changed BadContent as a "failure":
diff -r b2322cdabd8a MoinMoin/security/antispam.py --- a/MoinMoin/security/antispam.py Tue Oct 03 15:32:55 2006 +0200 +++ b/MoinMoin/security/antispam.py Thu Oct 12 14:57:09 2006 -0400 @@ -127,6 +127,8 @@ def getblacklist(request, pagename, do_u raise WikirpcError("failed to get BadContent data", response) p._write_file(response) + else: + failure.update("") # we "failed" to get a modified version invalidate_cache = True
that patches should "just work". -- TheAnarcat 2006-10-12 19:05:25
Plan
- Priority:
- Assigned to:
- Status: fixed in moin 1.5