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

Unified Diff: sitescripts/filterhits/common.py

Issue 4615801646612480: Issue 395 - Filter hits statistics backend (Closed)
Patch Set: Addressed Sebastian's and Wladimir's comments. Created March 27, 2015, 3:08 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/common.py
diff --git a/sitescripts/reports/bin/removeOldUsers.py b/sitescripts/filterhits/common.py
similarity index 64%
copy from sitescripts/reports/bin/removeOldUsers.py
copy to sitescripts/filterhits/common.py
index 56c915a243c269e8432334676becb8174d314735..aaa64f2dd489fa0bd7e01e7c1b3e0279b116e650 100644
--- a/sitescripts/reports/bin/removeOldUsers.py
+++ b/sitescripts/filterhits/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")]
Wladimir Palant 2015/03/27 16:29:06 Given that this is only useful for the web handler
kzar 2015/03/27 22:15:00 Done.

Powered by Google App Engine
This is Rietveld