fix: remove CloseFrame delay (#6106)

This commit is contained in:
Loakesh Indiran
2025-02-26 10:05:51 +05:30
committed by GitHub
parent f93b05cdb5
commit dccc130b3a
2 changed files with 0 additions and 13 deletions
-2
View File
@@ -385,8 +385,6 @@ pub struct Config {
pub struct WebSocket {
#[env_config(name = "ZO_WEBSOCKET_ENABLED", default = false)]
pub enabled: bool,
#[env_config(name = "ZO_WEBSOCKET_CLOSE_FRAME_DELAY", default = 50)]
pub close_frame_delay: u64, // in milliseconds
#[env_config(name = "ZO_WEBSOCKET_SESSION_IDLE_TIMEOUT_SECS", default = 300)]
pub session_idle_timeout_secs: i64,
#[env_config(name = "ZO_WEBSOCKET_SESSION_MAX_LIFETIME_SECS", default = 3600)]
@@ -347,17 +347,6 @@ async fn cleanup_and_close_session(req_id: &str, close_reason: Option<CloseReaso
);
}
#[cfg(feature = "enterprise")]
{
// sleep for the interval duration in milliseconds to avoid race condition
// between the close frame (control frame) and the data frame
let cfg = get_config();
let interval = cfg.websocket.close_frame_delay;
if interval > 0 {
tokio::time::sleep(std::time::Duration::from_millis(interval)).await;
}
}
// Attempt to close the session
if let Err(e) = session.close(close_reason).await {
log::error!(