mirror of
https://github.com/nullishamy/ferri.git
synced 2025-06-28 00:54:17 +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 {
|
match req {
|
||||||
InboxRequest::Delete(_, _) => {
|
InboxRequest::Delete(_, _) => {
|
||||||
todo!()
|
warn!("unimplemented Delete");
|
||||||
},
|
},
|
||||||
InboxRequest::Follow { activity, followed, mut conn, outbound } => {
|
InboxRequest::Follow { activity, followed, mut conn, outbound } => {
|
||||||
let kid = key_id(&followed);
|
let kid = key_id(&followed);
|
||||||
|
|
|
@ -46,22 +46,27 @@ impl RequestQueue {
|
||||||
let fut = async move {
|
let fut = async move {
|
||||||
info!("using config {:#?}, queue is up", config);
|
info!("using config {:#?}, queue is up", config);
|
||||||
let mut recv = self.recv;
|
let mut recv = self.recv;
|
||||||
let http = HttpClient::new();
|
|
||||||
|
|
||||||
while let Some(req) = recv.recv().await {
|
while let Some(req) = recv.recv().await {
|
||||||
info!(?req, "got a message into the queue");
|
info!(?req, "got a message into the queue");
|
||||||
|
|
||||||
match req {
|
// Spawn up a new task so that we can run concurrently and also so we can not die if it panics
|
||||||
QueueMessage::Heartbeat => {
|
tokio::spawn(async {
|
||||||
info!("heartbeat on queue");
|
let http = HttpClient::new();
|
||||||
},
|
|
||||||
QueueMessage::Inbound(inbox_request) => {
|
match req {
|
||||||
handle_inbox_request(inbox_request, &http).await;
|
QueueMessage::Heartbeat => {
|
||||||
},
|
info!("heartbeat on queue");
|
||||||
QueueMessage::Outbound(outbox_request) => {
|
},
|
||||||
handle_outbox_request(outbox_request, &http).await;
|
QueueMessage::Inbound(inbox_request) => {
|
||||||
},
|
handle_inbox_request(inbox_request, &http).await;
|
||||||
}
|
},
|
||||||
|
QueueMessage::Outbound(outbox_request) => {
|
||||||
|
handle_outbox_request(outbox_request, &http).await;
|
||||||
|
},
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}.instrument(span);
|
}.instrument(span);
|
||||||
|
|
||||||
|
|
|
@ -143,6 +143,7 @@ pub async fn statuses(
|
||||||
FROM post p
|
FROM post p
|
||||||
INNER JOIN user u on p.user_id = u.id
|
INNER JOIN user u on p.user_id = u.id
|
||||||
WHERE u.id = ?1
|
WHERE u.id = ?1
|
||||||
|
ORDER BY p.created_at DESC
|
||||||
"#, uid)
|
"#, uid)
|
||||||
.fetch_all(&mut **db)
|
.fetch_all(&mut **db)
|
||||||
.await
|
.await
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue