mirror of
https://github.com/nullishamy/ferri.git
synced 2025-06-27 16:44:18 +00:00
fix: small bits
This commit is contained in:
parent
ecb706e93f
commit
f0e287c78d
3 changed files with 19 additions and 13 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue