update connection_for_receiving
This commit is contained in:
parent
db89ca7bc2
commit
93874ee3ed
|
@ -1,4 +1,5 @@
|
|||
use crate::chat::types::PackedMessage;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use crate::db;
|
||||
use async_std::{
|
||||
io,
|
||||
|
@ -94,20 +95,18 @@ async fn connection_for_receiving(
|
|||
// log::debug!("they are different");
|
||||
match res {
|
||||
PackedMessage::FromCore(json) => {
|
||||
let j = json.clone();
|
||||
sender
|
||||
.send(Message::Text(j))
|
||||
.await
|
||||
.expect("Couldn't send message");
|
||||
async_std::task::block_on(sender
|
||||
.send(Message::Text(json))).expect("Couldn't send message")
|
||||
|
||||
}
|
||||
PackedMessage::FromFreenet(response) => {
|
||||
let r = response.clone();
|
||||
log::debug!("Got:\n {}", &response);
|
||||
sender
|
||||
// TODO freenet_response_handler
|
||||
.send(Message::Text(r.to_string()))
|
||||
.await
|
||||
.expect("Couldn't send messge");
|
||||
async_std::task::block_on(sender
|
||||
// TODO freenet_response_handler
|
||||
.send(Message::Text(r.to_string())));
|
||||
// .await
|
||||
// .expect("Couldn't send messge");
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ pub async fn request_repeater(ss: SP) -> io::Result<()> {
|
|||
//TODO create a field with tracked users
|
||||
log::debug!("Request Repeater Started!");
|
||||
loop {
|
||||
let time = std::time::Duration::from_millis(600);
|
||||
let time = std::time::Duration::from_millis(1300);
|
||||
std::thread::sleep(time);
|
||||
log::debug!("enough sleep");
|
||||
match ss.send(PackedMessage::ToFreenet(
|
||||
|
|
Loading…
Reference in a new issue