Added redispatch button and fixed typo in load balancing code

This commit is contained in:
Simon
2018-06-24 10:07:46 -04:00
parent 1ac510ff53
commit a6d753c6ee
6 changed files with 66 additions and 4 deletions

View File

@@ -83,6 +83,16 @@ class TaskManagerDatabase:
else:
return None
def pop_all_tasks(self):
tasks = self.get_tasks()
with sqlite3.connect(self.db_path) as conn:
cursor = conn.cursor()
cursor.execute("DELETE FROM Queue")
return tasks
def put_task(self, task: Task):
with sqlite3.connect(self.db_path) as conn: