From 9bda7a16faf4526eaf9035ba1cb80ebf65fd7fd9 Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 25 Jun 2023 04:12:07 -0700 Subject: fix deadlock when handling github push events --- src/main.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index f4009bc..ab6b62c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -758,6 +758,8 @@ async fn main() { let web_config: WebserverConfig = serde_json::from_reader(std::fs::File::open(config_path).expect("file exists and is accessible")).expect("valid json for WebserverConfig"); let mut psks = PSKS.write().expect("can write lock"); *psks = web_config.psks.clone(); + // drop write lock so we can read PSKS elsewhere WITHOUT deadlocking. + std::mem::drop(psks); let config = RustlsConfig::from_pem_file( web_config.cert_path.clone(), -- cgit v1.1