Skip to content

Commit f246457

Browse files
committed
fix(schedular server): parse port to number before passing it to Tcp
1 parent 3f4552c commit f246457

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

gui/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ fn save_inputs(conf: &DeadlinerConf) -> Result<(), String> {
170170

171171
// !Here we setup a schedule to update the wallpaper
172172
let schedular_exec = format!("deadliner-schedular{}", &get_current_file_ext());
173-
println!("{:?}", new_path(&schedular_exec).to_str().unwrap());
174173
unwrap_or_return!(
175174
Command::new(new_path(&schedular_exec))
176175
.arg("skip-update-on-launch")

schedular/src/server.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ use std::{
99
};
1010

1111
pub fn run_server(exit: Arc<Mutex<bool>>) {
12-
let port = fs::read_to_string(new_path("port.txt")).unwrap();
12+
let port: u16 = fs::read_to_string(new_path("port.txt"))
13+
.unwrap()
14+
.trim()
15+
.parse()
16+
.unwrap();
1317
let addr = format!("127.0.0.1:{}", port);
1418

1519
let listener = TcpListener::bind(&addr).unwrap();

schedular/src/system_tray.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ pub fn bg_system_tray(exit: Arc<Mutex<bool>>) {
8383
} else {
8484
let gui_exec = format!("deadliner{}", &get_current_file_ext());
8585

86-
println!("{:?}", new_path(&gui_exec).to_str().unwrap());
87-
8886
let child_process = Command::new(new_path(&gui_exec)).spawn().unwrap();
8987

9088
*gui_handler = Some(child_process);

0 commit comments

Comments
 (0)