Skip to content

Commit 2dcb327

Browse files
committed
fix: use std::thread::spawn() in hot_reload_tls_cfg() instead of tokio::spawn() because loop{} blocks HTTP serving in some environment
1 parent 3a5ac1c commit 2dcb327

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/util.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,10 @@ pub fn hot_reload_tls_cfg(
143143
load_tls_config(cert_path.deref(), key_path.deref()).unwrap(),
144144
)));
145145

146-
tokio::spawn({
146+
// NOTE: tokio::spawn() blocks servers in some environment because of `loop {}`
147+
std::thread::spawn({
147148
let tls_cfg_rwlock = tls_cfg_rwlock_arc.clone();
148-
async move {
149+
move || {
149150
use notify::Watcher;
150151
let (tx, rx) = std::sync::mpsc::channel();
151152

0 commit comments

Comments
 (0)