Use the Db cursor to delete peers

This commit is contained in:
shortcutme 2018-10-30 04:39:59 +01:00
parent 9dab48d135
commit 281f379ced
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -79,8 +79,8 @@ class ContentDbPlugin(object):
cur = self.getCursor()
cur.execute("BEGIN")
try:
self.execute("DELETE FROM peer WHERE site_id = :site_id", {"site_id": site_id})
self.cur.cursor.executemany(
cur.execute("DELETE FROM peer WHERE site_id = :site_id", {"site_id": site_id})
cur.cursor.executemany(
"INSERT INTO peer (site_id, address, port, hashfield, reputation, time_added, time_found) VALUES (?, ?, ?, ?, ?, ?, ?)",
self.iteratePeers(site)
)