Commit 741466ad authored by Felix Häcker's avatar Felix Häcker

clear everything from previous task when starting a new one

parent c5a7712b
......@@ -71,7 +71,6 @@ impl AsyncClient{
pub fn clear_task(&mut self){
*self.next_task.lock().unwrap() = None;
self.sender.send(Message::Clear);
}
pub fn start_loop(&mut self){
......@@ -85,6 +84,9 @@ impl AsyncClient{
if(next_task.lock().unwrap().clone().is_some()){
let mut sync_client = Client::new(&base_url);
// clear everything from previous task
sender.send(Message::Clear);
// Get the task, and unset "next_task"
let task: Task = next_task.lock().unwrap().clone().unwrap();
*next_task.lock().unwrap() = None;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment