diff MoinMoin/macro/AbandonedPages.py @ 5996:524db6237b48

AbandonedPages macro: check user agent to reduce load caused by bots
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 09 Jun 2013 16:35:56 +0200
parents e5a2e21afc17
children
line wrap: on
line diff
--- a/MoinMoin/macro/AbandonedPages.py	Sat Jun 08 23:16:08 2013 +0200
+++ b/MoinMoin/macro/AbandonedPages.py	Sun Jun 09 16:35:56 2013 +0200
@@ -13,5 +13,7 @@
 from MoinMoin.macro import RecentChanges
 
 def macro_AbandonedPages(macro):
+    if macro.request.isSpiderAgent: # reduce bot cpu usage
+        return ''
     return RecentChanges.macro_RecentChanges(macro, abandoned=True)