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:
alex-ds13
2024-12-26 10:52:00 +00:00
committed by LGUG2Z
parent 53a83eedb5
commit 4babf336ec

View File

@@ -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);