Skip to content

Commit

Permalink
daemons
Browse files Browse the repository at this point in the history
  • Loading branch information
JieningYu committed Dec 7, 2023
1 parent a30764f commit 659f00a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{path::PathBuf, sync::Arc};
use std::{path::PathBuf, sync::Arc, time::Duration};

use axum::{
routing::{get, post},
Expand Down Expand Up @@ -105,7 +105,16 @@ async fn main() {
&format!("/{}/{}", config.mng_secret, config.mng_reject_papers_secret),
post(paper::reject::<FsHandle>),
)
.with_state(state);
.with_state(state.clone());

tokio::spawn(dmds_tokio_fs::daemon(
state.papers.clone(),
Duration::from_secs(45),
));
tokio::spawn(dmds_tokio_fs::daemon(
state.questions.clone(),
Duration::from_secs(120),
));

axum::serve(
tokio::net::TcpListener::bind(format!("127.0.0.1:{port}"))
Expand Down

0 comments on commit 659f00a

Please sign in to comment.