feat: queue infra

This commit is contained in:
nullishamy 2025-04-26 12:44:45 +01:00
parent 2270324711
commit 4b88100373
Signed by: amy
SSH key fingerprint: SHA256:WmV0uk6WgAQvDJlM8Ld4mFPHZo02CLXXP5VkwQ5xtyk
4 changed files with 77 additions and 3 deletions

View file

@ -1,6 +1,8 @@
use main::ap::http::HttpClient;
use rocket::{State, get, response::status};
use rocket_db_pools::Connection;
use main::ap;
use crate::OutboundQueue;
use uuid::Uuid;
@ -84,7 +86,9 @@ pub async fn resolve_user(acct: &str, host: &str) -> types::Person {
}
#[get("/test")]
pub async fn test(http: &State<HttpClient>) -> &'static str {
pub async fn test(http: &State<HttpClient>, outbound: &State<OutboundQueue>) -> &'static str {
outbound.0.send(ap::QueueMessage::Heartbeat);
let user = resolve_user("amy@fedi.amy.mov", "fedi.amy.mov").await;
let post = activity::CreateActivity {