refactor
This commit is contained in:
1 parent
9132d85f74
commit
457c74d203
1 file changed
+5
-9
@@ -8,15 +8,7 @@ lazy_static::lazy_static! {
|
|||||||
static ref STOP: Arc<Mutex<bool>> = Arc::new(Mutex::new(true));
|
static ref STOP: Arc<Mutex<bool>> = Arc::new(Mutex::new(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_running() -> bool {
|
pub fn bootstrap(license: &str, host: &str) {
|
||||||
!*STOP.lock().unwrap()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn start(license: &str, host: &str) {
|
|
||||||
if is_running() {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
*STOP.lock().unwrap() = false;
|
|
||||||
let port = rendezvous_server::DEFAULT_PORT;
|
let port = rendezvous_server::DEFAULT_PORT;
|
||||||
let addr = format!("0.0.0.0:{}", port);
|
let addr = format!("0.0.0.0:{}", port);
|
||||||
let addr2 = format!("0.0.0.0:{}", port.parse::<i32>().unwrap_or(0) - 1);
|
let addr2 = format!("0.0.0.0:{}", port.parse::<i32>().unwrap_or(0) - 1);
|
||||||
@@ -47,3 +39,7 @@ pub fn start(license: &str, host: &str) {
|
|||||||
pub fn stop() {
|
pub fn stop() {
|
||||||
*STOP.lock().unwrap() = true;
|
*STOP.lock().unwrap() = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn start() {
|
||||||
|
*STOP.lock().unwrap() = false;
|
||||||
|
}
|
||||||
Reference in new issue
Block a user