init
This commit is contained in:
+12
-1
@@ -72,7 +72,7 @@ impl App {
|
||||
services
|
||||
.realtime_registry
|
||||
.start_listening(repositories.clone(), event_bus.clone());
|
||||
let gateway = Arc::new(GatewayManager::new(services.clone()));
|
||||
let gateway = Arc::new(GatewayManager::new(services.clone(), repositories.clone()));
|
||||
gateway.start(event_bus.clone());
|
||||
|
||||
let state = AppState {
|
||||
@@ -95,6 +95,17 @@ impl App {
|
||||
|
||||
let config = self.state.config.clone();
|
||||
|
||||
let cleanup_state = self.state.clone();
|
||||
tokio::spawn(async move {
|
||||
let mut interval = tokio::time::interval(Duration::from_secs(3600));
|
||||
loop {
|
||||
interval.tick().await;
|
||||
if let Err(error) = crate::routes::attachment::handlers::cleanup_expired(&cleanup_state).await {
|
||||
tracing::warn!(%error, "Attachment cleanup failed");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Initialize HTTP Server
|
||||
let (http_server, http_shutdown_tx) = HttpServer::new(&config.network, self.state.clone());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user