fix: previous session.close read&write error
Signed-off-by: Kingtous <kingtous@qq.com>
This commit is contained in:
parent
60a628aefe
commit
d0422fa87e
@ -179,7 +179,6 @@ impl Session {
|
||||
/// Close the session.
|
||||
pub fn close(&self) {
|
||||
self.send(Data::Close);
|
||||
let _ = SESSIONS.write().unwrap().remove(&self.id);
|
||||
}
|
||||
|
||||
/// Reconnect to the current session.
|
||||
|
@ -133,6 +133,7 @@ pub fn session_close(id: String) {
|
||||
if let Some(session) = SESSIONS.read().unwrap().get(&id) {
|
||||
session.close();
|
||||
}
|
||||
let _ = SESSIONS.write().unwrap().remove(&id);
|
||||
}
|
||||
|
||||
pub fn session_refresh(id: String) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user