[tor-commits] [gettor/master] Update how stats table is updated

hiro at torproject.org hiro at torproject.org
Thu May 23 15:22:37 UTC 2019


commit adceca12dbcfac4465b69ae4cff64566ebbfb30e
Author: hiro <hiro at torproject.org>
Date:   Thu May 23 17:22:32 2019 +0200

    Update how stats table is updated
---
 gettor/utils/db.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gettor/utils/db.py b/gettor/utils/db.py
index 083020d..c48d36a 100644
--- a/gettor/utils/db.py
+++ b/gettor/utils/db.py
@@ -90,10 +90,10 @@ class SQLite3(object):
 		now_str = datetime.now().strftime("%Y%m%d")
 		query = "REPLACE INTO stats(num_requests, platform, language, "\
 		"command, service, date) VALUES(COALESCE((SELECT num_requests FROM stats "\
-		"WHERE date=?)+1, 0), ?, ?, ?, ?, ?) "\
+		"WHERE platform=? AND language=? AND date=?)+1, 0), ?, ?, ?, ?, ?) "\
 
 		return self.dbpool.runQuery(
-			query, (now_str, platform, language, command, service, now_str)
+			query, (platform, language, now_str, platform, language, command, service, now_str)
 		).addCallback(self.query_callback).addErrback(self.query_errback)
 
 	def get_links(self, platform, language, status):



More information about the tor-commits mailing list