From fb7f4c1b31d3a7f517be46cfcda3757a9df467d7 Mon Sep 17 00:00:00 2001 From: alemi Date: Tue, 5 Sep 2023 20:40:10 +0200 Subject: [PATCH] fix: updated cached buffer immediately --- src/buffer/worker.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/buffer/worker.rs b/src/buffer/worker.rs index 3156c03..c27cbb1 100644 --- a/src/buffer/worker.rs +++ b/src/buffer/worker.rs @@ -109,6 +109,7 @@ impl ControllerWorker for BufferControllerWorker { match res { None => return tracing::warn!("client closed operation stream"), Some(op) => { + let _ = self.update(&op); clientside.push_back(op.clone()); last_seen_tick = self.operation_tick.load(Ordering::Acquire); } @@ -159,7 +160,6 @@ impl ControllerWorker for BufferControllerWorker { // client operation waiting for us to be enqueued if serverside.is_empty() { while let Some(op) = clientside.get(0) { - self.update(op); if !send_opseq(&mut tx, self.uid.clone(), self.path.clone(), op.clone()).await { break } clientside.pop_front(); }