diff options
author | FxQnLr <[email protected]> | 2024-04-15 20:33:32 +0200 |
---|---|---|
committer | FxQnLr <[email protected]> | 2024-04-15 20:33:32 +0200 |
commit | d3cf93fb6c9b7e0faf9b7907328f0a042009e164 (patch) | |
tree | a55ec4f56e16de701c6764b559c776b38bc11637 /src/services | |
parent | b615f6e34e084d520dcc301058b5926074188500 (diff) | |
download | webol-d3cf93fb6c9b7e0faf9b7907328f0a042009e164.tar webol-d3cf93fb6c9b7e0faf9b7907328f0a042009e164.tar.gz webol-d3cf93fb6c9b7e0faf9b7907328f0a042009e164.zip |
Closes #35. Entry of Ip optional, error on ping request without saved ip
Diffstat (limited to 'src/services')
-rw-r--r-- | src/services/ping.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/services/ping.rs b/src/services/ping.rs index 1bf022d..4e0ffcf 100644 --- a/src/services/ping.rs +++ b/src/services/ping.rs | |||
@@ -28,7 +28,9 @@ pub async fn spawn( | |||
28 | 28 | ||
29 | let mut msg: Option<BroadcastCommand> = None; | 29 | let mut msg: Option<BroadcastCommand> = None; |
30 | while msg.is_none() { | 30 | while msg.is_none() { |
31 | let ping = surge_ping::ping(device.ip.ip(), &payload).await; | 31 | // Safe: Only called when ip is set |
32 | let ip = device.ip.unwrap(); | ||
33 | let ping = surge_ping::ping(ip.ip(), &payload).await; | ||
32 | 34 | ||
33 | if let Err(ping) = ping { | 35 | if let Err(ping) = ping { |
34 | let ping_timeout = matches!(ping, surge_ping::SurgeError::Timeout { .. }); | 36 | let ping_timeout = matches!(ping, surge_ping::SurgeError::Timeout { .. }); |