mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-06 16:09:41 +00:00
fix: remove CloseFrame delay (#6106)
This commit is contained in:
@@ -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!(
|
||||
|
||||
Reference in New Issue
Block a user