diff options
| author | Mica White <botahamec@outlook.com> | 2026-09-05 21:10:34 -0400 |
|---|---|---|
| committer | Mica White <botahamec@outlook.com> | 2026-09-05 21:10:34 -0400 |
| commit | dca1f88823691c6f86ce7141b2eb0c8c88f62cd8 (patch) | |
| tree | 2d3f6153818a3420c9131cf710b6ec1cedec5eb4 /src/bin/git-autosave-daemon.rs | |
| parent | 1897aa4c604a0d9ab81f84dbff687b7f42bc1f0f (diff) | |
Reduce battery consumption when offline
Diffstat (limited to 'src/bin/git-autosave-daemon.rs')
| -rw-r--r-- | src/bin/git-autosave-daemon.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/git-autosave-daemon.rs b/src/bin/git-autosave-daemon.rs index d9af1e5..fa6725e 100644 --- a/src/bin/git-autosave-daemon.rs +++ b/src/bin/git-autosave-daemon.rs @@ -31,7 +31,7 @@ fn push_queue( loop { while ping::new("8.8.8.8".parse().unwrap()) .socket_type(ping::SocketType::DGRAM) - .timeout(Duration::from_secs(60)) + .timeout(Duration::from_secs(5)) .ttl(128) .send() .is_err() @@ -46,7 +46,7 @@ fn push_queue( "There is no Internet connection, so pushes to the repository have been queued" ); } - std::thread::yield_now(); + std::thread::sleep(Duration::from_secs(60)); } while let Ok(workdir) = consumer.try_recv() { |
