API endpoint to cancel task

This commit is contained in:
Simon
2018-10-26 18:13:47 -04:00
parent 1d3318f6e2
commit db26e851a4
2 changed files with 24 additions and 0 deletions

View File

@@ -400,6 +400,12 @@ class Database:
else:
return None
def delete_task(self, website_id):
with sqlite3.connect(self.db_path) as conn:
cursor = conn.cursor()
cursor.execute("DELETE FROM Queue WHERE website_id=?", (website_id, ))
def complete_task(self, website_id: int, name: str) -> Task:
with sqlite3.connect(self.db_path) as conn: