We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d32fbb commit 737b7dbCopy full SHA for 737b7db
lua/xbase/lib.rs
@@ -33,13 +33,13 @@ pub fn is_running(_: &Lua, _: ()) -> LuaResult<bool> {
33
34
/// Ensure that daemon is currently running in background
35
pub fn ensure(lua: &Lua, _: ()) -> LuaResult<bool> {
36
- // FIXME(dameon): resulting in connection refused
37
if is_running(lua, ()).unwrap() {
38
Ok(false)
39
- } else if Command::new(DAEMON_BINARY_PATH).spawn().is_ok() {
+ } else {
+ Command::new(DAEMON_BINARY_PATH).spawn().unwrap();
40
+ // Give time for the daemon to be started
41
+ std::thread::sleep(std::time::Duration::new(1, 0));
42
lua.info("Spawned Background Server")?;
43
Ok(true)
- } else {
- panic!("Unable to spawn background server");
44
}
45
0 commit comments