Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/filterhits/web/common.py

Issue 4615801646612480: Issue 395 - Filter hits statistics backend (Closed)
Patch Set: Make test log directory path configurable and ensure it's always cleared. Created March 30, 2015, 3:12 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sitescripts/filterhits/web/common.py
diff --git a/sitescripts/reports/bin/removeOldUsers.py b/sitescripts/filterhits/web/common.py
similarity index 64%
copy from sitescripts/reports/bin/removeOldUsers.py
copy to sitescripts/filterhits/web/common.py
index 56c915a243c269e8432334676becb8174d314735..aaa64f2dd489fa0bd7e01e7c1b3e0279b116e650 100644
--- a/sitescripts/reports/bin/removeOldUsers.py
+++ b/sitescripts/filterhits/web/common.py
@@ -15,16 +15,6 @@
# You should have received a copy of the GNU General Public License
# along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
-from sitescripts.utils import setupStderr
-from sitescripts.reports.utils import get_db, executeQuery
-
-def removeOldUsers(months=4):
- cursor = get_db().cursor()
- executeQuery(cursor,
- '''DELETE FROM #PFX#users WHERE ADDDATE(mtime, INTERVAL %s MONTH) < NOW()''',
- (months))
- get_db().commit()
-
-if __name__ == '__main__':
- setupStderr()
- removeOldUsers()
+def show_error(message, start_response, status="400 Processing Error"):
+ start_response(status, [("Content-Type", "text/plain; charset=utf-8")])
+ return [message.encode("utf-8")]

Powered by Google App Engine
This is Rietveld