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