format-sse-fix2

This commit is contained in:
Untone 2023-10-20 20:52:26 +03:00
parent 85502a694d
commit 7dd060bfdd

View File

@ -25,7 +25,7 @@ struct RedisMessageData {
action: String
}
#[derive(Serialize, Deserialize, Clone, Debug)]
#[derive(Serialize, Deserialize, Clone, Debug, Display)]
pub struct SSEMessageData {
payload: HashMap<String, Value>,
action: String,
@ -146,7 +146,7 @@ async fn connect_handler(
let formatted_server_event = format!(
"id: {}\ndata: {}\n\n",
event_id,
message_data
server_event
);
Some((Ok::<_, actix_web::Error>(Bytes::from(formatted_server_event)), rx))