Skip to content

Commit f3a5527

Browse files
committed
main: tokio_main: re-read config on loop iterations
This should also fix `stop_on_disconnect`
1 parent 376f89c commit f3a5527

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ async fn tokio_main(
203203
None
204204
};
205205

206-
let cfg = config.read().await.clone();
206+
let mut cfg = config.read().await.clone();
207207
if let Some(ref bindaddr) = cfg.webserver {
208208
// preparing AppState and starting webserver
209209
let app = web::app(state.clone().into());
@@ -323,6 +323,8 @@ async fn tokio_main(
323323
NAME
324324
);
325325
tokio::time::sleep(std::time::Duration::from_secs(1)).await;
326+
// re-read config
327+
cfg = config.read().await.clone();
326328
}
327329
}
328330

0 commit comments

Comments
 (0)