Try fix Recursive use of cursors ProgrammingError by creating new cursor for every execute and move Lock to db

This commit is contained in:
shortcutme 2019-11-27 03:07:08 +01:00
parent afd23849a6
commit fca9db7972
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
6 changed files with 51 additions and 27 deletions

View file

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