diff options
Diffstat (limited to 'src/lua')
-rw-r--r-- | src/lua/mod.rs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/lua/mod.rs b/src/lua/mod.rs index 75b9cec..f186e6b 100644 --- a/src/lua/mod.rs +++ b/src/lua/mod.rs @@ -224,13 +224,15 @@ impl BuildEnv { pub async fn run_build(self, script: &[u8]) -> Result<(), LuaError> { let script = script.to_vec(); - let res: Result<(), LuaError> = std::thread::spawn(move || { - self.lua.context(|lua_ctx| { - lua_ctx.load(&script) - .set_name("goodfile")? - .exec() - }) - }).join().unwrap(); + let res: Result<(), LuaError> = tokio::task::spawn_blocking(|| { + std::thread::spawn(move || { + self.lua.context(|lua_ctx| { + lua_ctx.load(&script) + .set_name("goodfile")? + .exec() + }) + }).join().unwrap() + }).await.unwrap(); eprintln!("lua res: {:?}", res); res } |