Explorar el Código

bin/ircd2: refactor locking a mutex

Dastan-glitch hace 3 años
padre
commit
5a4ca9bcdc
Se han modificado 1 ficheros con 1 adiciones y 2 borrados
  1. 1 2
      bin/ircd2/src/irc/mod.rs

+ 1 - 2
bin/ircd2/src/irc/mod.rs

@@ -210,11 +210,10 @@ impl IrcServer {
         loop {
             let (msg, subscription_id) = recv.recv().await?;
 
-            let prev = model.lock().await.get_head_hash();
             match msg {
                 NotifierMsg::Privmsg(msg) => {
                     let event = Event {
-                        previous_event_hash: prev,
+                        previous_event_hash: model.lock().await.get_head_hash(),
                         action: msg.clone(),
                         timestamp: get_current_time(),
                         read_confirms: 0,