Slots can be updated without removing & adding

This commit is contained in:
Simon
2018-06-24 09:39:44 -04:00
parent 348914aba9
commit 1ac510ff53
5 changed files with 59 additions and 15 deletions

View File

@@ -304,6 +304,14 @@ class Database:
return [task.CrawlServer(r[0], r[1], r[2], r[3], r[4]) for r in cursor.fetchall()]
def update_crawl_server(self, server_id, url, name, slots):
with sqlite3.connect(self.db_path) as conn:
cursor = conn.cursor()
cursor.execute("UPDATE CrawlServer SET url=?, name=?, slots=? WHERE id=?", (url, name, slots, server_id))
conn.commit()