GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Commit c2930fe3 authored by Cecylia Bocovich's avatar Cecylia Bocovich
Browse files

Remove completed gettor requests from database

This will remove gettor requests from the requests database when they
are completed (rather than changing the status to 'SENT'). There's no
need to keep this information around, and we don't want to store
hashed email addresses as identifiers long term.
parent 3dfc2fdb
...@@ -191,9 +191,8 @@ class Sendmail(object): ...@@ -191,9 +191,8 @@ class Sendmail(object):
service="email" service="email"
) )
yield self.conn.update_request( yield self.conn.remove_request(
id=id, hid=hid.hexdigest(), status="SENT", id=id, service="email", date=date
service="email", date=date
) )
except SMTPError as e: except SMTPError as e:
...@@ -245,9 +244,8 @@ class Sendmail(object): ...@@ -245,9 +244,8 @@ class Sendmail(object):
service="email" service="email"
) )
yield self.conn.update_request( yield self.conn.remove_request(
id=id, hid=hid.hexdigest(), status="SENT", id=id, service="email", date=date
service="email", date=date
) )
except SMTPError as e: except SMTPError as e:
......
...@@ -72,15 +72,14 @@ class SQLite3(object): ...@@ -72,15 +72,14 @@ class SQLite3(object):
query, (id, service) query, (id, service)
).addCallback(self.query_callback).addErrback(self.query_errback) ).addCallback(self.query_callback).addErrback(self.query_errback)
def update_request(self, id, hid, status, service, date): def remove_request(self, id, service, date):
""" """
Update request record in the database Removes completed request record from the database
""" """
query = "UPDATE requests SET id=?, status=? WHERE id=? AND "\ query = "DELETE FROM requests WHERE id=? AND service=? AND date=?"
"service=? AND date=?"
return self.dbpool.runQuery( return self.dbpool.runQuery(
query, (hid, status, id, service, date) query, (id, service, date)
).addCallback(self.query_callback).addErrback(self.query_errback) ).addCallback(self.query_callback).addErrback(self.query_errback)
def update_stats(self, command, service, platform=None, language='en'): def update_stats(self, command, service, platform=None, language='en'):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment