From e70e735c885847cdfccb23cade0d5289fba5cc54 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Fri, 20 Dec 2024 11:17:11 +0100 Subject: [PATCH] chore(1-3217): run in a neverending loop --- server/src/http/feature_refresher.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/server/src/http/feature_refresher.rs b/server/src/http/feature_refresher.rs index c82c4c27..1468915e 100644 --- a/server/src/http/feature_refresher.rs +++ b/server/src/http/feature_refresher.rs @@ -366,8 +366,16 @@ impl FeatureRefresher { }) .map_err(|e| warn!("Error in SSE stream: {:?}", e)); - while let Ok(Some(handler)) = stream.try_next().await { - handler.await; + loop { + match stream.try_next().await { + Ok(Some(handler)) => handler.await, + Ok(None) => { + info!("SSE stream ended? Handler was None, anyway. Reconnecting."); + } + Err(e) => { + info!("SSE stream error: {e:?}. Reconnecting"); + } + } } }); }