feat: add message storing in DB

UNTESTED! Should work but might be really slow
This commit is contained in:
Radical 2025-05-17 11:04:48 +02:00
parent 95964e6fec
commit c5d14ac063
2 changed files with 22 additions and 0 deletions

View file

@ -97,6 +97,7 @@ pub async fn echo(req: HttpRequest, path: web::Path<(Uuid, Uuid)>, stream: web::
Ok(AggregatedMessage::Text(text)) => {
// echo text message
redis::cmd("PUBLISH").arg(&[channel_uuid.to_string(), text.to_string()]).exec_async(&mut conn).await.unwrap();
channel.new_message(&data.pool, uuid, text.to_string()).await.unwrap();
}
Ok(AggregatedMessage::Binary(bin)) => {