diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/main.rs b/src/main.rs index 9c31ec8..124c44e 100644 --- a/src/main.rs +++ b/src/main.rs | |||
@@ -4,7 +4,7 @@ use axum::{Router, routing::post}; | |||
4 | use axum::routing::{get, put}; | 4 | use axum::routing::{get, put}; |
5 | use sqlx::PgPool; | 5 | use sqlx::PgPool; |
6 | use time::util::local_offset; | 6 | use time::util::local_offset; |
7 | use tokio::sync::mpsc::{self, Sender}; | 7 | use tokio::sync::broadcast::{channel, Sender}; |
8 | use tracing::{info, level_filters::LevelFilter}; | 8 | use tracing::{info, level_filters::LevelFilter}; |
9 | use tracing_subscriber::{EnvFilter, fmt::{self, time::LocalTime}, prelude::*}; | 9 | use tracing_subscriber::{EnvFilter, fmt::{self, time::LocalTime}, prelude::*}; |
10 | use crate::config::SETTINGS; | 10 | use crate::config::SETTINGS; |
@@ -46,15 +46,8 @@ async fn main() { | |||
46 | let db = init_db_pool().await; | 46 | let db = init_db_pool().await; |
47 | sqlx::migrate!().run(&db).await.unwrap(); | 47 | sqlx::migrate!().run(&db).await.unwrap(); |
48 | 48 | ||
49 | let (tx, mut rx) = mpsc::channel(32); | 49 | let (tx, _) = channel(32); |
50 | 50 | ||
51 | // FIXME: once_cell? or just static mutable | ||
52 | tokio::spawn( async move { | ||
53 | while let Some(message) = rx.recv().await { | ||
54 | println!("GOT = {}", message); | ||
55 | } | ||
56 | }); | ||
57 | |||
58 | let shared_state = Arc::new(AppState { db, ping_send: tx }); | 51 | let shared_state = Arc::new(AppState { db, ping_send: tx }); |
59 | 52 | ||
60 | let app = Router::new() | 53 | let app = Router::new() |
@@ -76,5 +69,4 @@ async fn main() { | |||
76 | pub struct AppState { | 69 | pub struct AppState { |
77 | db: PgPool, | 70 | db: PgPool, |
78 | ping_send: Sender<String>, | 71 | ping_send: Sender<String>, |
79 | // ping_receive: Receiver<String> | ||
80 | } | 72 | } |