fix: small bits

This commit is contained in:
nullishamy 2025-05-03 22:47:40 +01:00
parent ecb706e93f
commit f0e287c78d
Signed by: amy
SSH key fingerprint: SHA256:WmV0uk6WgAQvDJlM8Ld4mFPHZo02CLXXP5VkwQ5xtyk
3 changed files with 19 additions and 13 deletions

View file

@ -32,7 +32,7 @@ pub async fn handle_inbox_request(
) {
match req {
InboxRequest::Delete(_, _) => {
todo!()
warn!("unimplemented Delete");
},
InboxRequest::Follow { activity, followed, mut conn, outbound } => {
let kid = key_id(&followed);

View file

@ -46,22 +46,27 @@ impl RequestQueue {
let fut = async move {
info!("using config {:#?}, queue is up", config);
let mut recv = self.recv;
let http = HttpClient::new();
while let Some(req) = recv.recv().await {
info!(?req, "got a message into the queue");
// Spawn up a new task so that we can run concurrently and also so we can not die if it panics
tokio::spawn(async {
let http = HttpClient::new();
match req {
QueueMessage::Heartbeat => {
info!("heartbeat on queue");
},
QueueMessage::Inbound(inbox_request) => {
handle_inbox_request(inbox_request, &http).await;
},
QueueMessage::Outbound(outbox_request) => {
handle_outbox_request(outbox_request, &http).await;
},
}
});
match req {
QueueMessage::Heartbeat => {
info!("heartbeat on queue");
},
QueueMessage::Inbound(inbox_request) => {
handle_inbox_request(inbox_request, &http).await;
},
QueueMessage::Outbound(outbox_request) => {
handle_outbox_request(outbox_request, &http).await;
},
}
}
}.instrument(span);

View file

@ -143,6 +143,7 @@ pub async fn statuses(
FROM post p
INNER JOIN user u on p.user_id = u.id
WHERE u.id = ?1
ORDER BY p.created_at DESC
"#, uid)
.fetch_all(&mut **db)
.await