Просмотр исходного кода

bin/tau: resolve confusion about saving and sending tasks

Dastan-glitch 4 лет назад
Родитель
Сommit
d39eca9983
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      bin/tau/taud/src/main.rs

+ 2 - 2
bin/tau/taud/src/main.rs

@@ -87,11 +87,11 @@ async fn start_sync_loop(
         select! {
             task = broadcast_rcv.recv().fuse() => {
                 let tk = task.map_err(Error::from)?;
-                info!(target: "tau", "Save the task: ref: {}", tk.ref_id);
                 if configured_ws.contains_key(&tk.workspace) {
                     let ws_info = configured_ws.get(&tk.workspace).unwrap();
                     if let Some(salsa_box) = &ws_info.encryption {
                         let encrypted_task = encrypt_task(&tk, &tk.workspace, salsa_box, &mut rng)?;
+                        info!(target: "tau", "Send the task: ref: {}", tk.ref_id);
                         raft_msgs_sender.send(encrypted_task).await.map_err(Error::from)?;
                     }
                 }
@@ -111,7 +111,7 @@ async fn start_sync_loop(
                         if !commits_received.lock().await.contains(&task.ref_id) {
                             commits_received.lock().await.push(task.ref_id.clone());
                         }
-                        info!(target: "tau", "Update the task: ref: {}", task.ref_id);
+                        info!(target: "tau", "Save the task: ref: {}", task.ref_id);
                         task.save(&datastore_path)?;
                     }
                 }