[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [gettor/master] Update how stats table is updated
commit adceca12dbcfac4465b69ae4cff64566ebbfb30e
Author: hiro <hiro@xxxxxxxxxxxxxx>
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):
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits