mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 22:12:53 +01:00
fix(bar): prevent komorebi connection from staling
Sometimes the bar would randomly stop receiving notifications from komorebi and would stop updating the `Komorebi` widget. This feels to me that the reason is the same one that used to happen on the `process_commands` from `komorebi` where the socket would get stuck reading an empty connection. This commit adds a read timeout to the socket to prevent that from happening and hopefully it should stop those situations where the bar would stop receiving notifications.
This commit is contained in:
@@ -351,6 +351,10 @@ fn main() -> color_eyre::Result<()> {
|
||||
for client in listener.incoming() {
|
||||
match client {
|
||||
Ok(subscription) => {
|
||||
match subscription.set_read_timeout(Some(Duration::from_secs(1))) {
|
||||
Ok(()) => {}
|
||||
Err(error) => tracing::error!("{}", error),
|
||||
}
|
||||
let mut buffer = Vec::new();
|
||||
let mut reader = BufReader::new(subscription);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user