fix: preserve pairings when stopping gateway (#7733)

Signed-off-by: The-Best-Codes <106822363+The-Best-Codes@users.noreply.github.com>
This commit is contained in:
BestCodes
2026-03-09 09:23:36 -05:00
committed by GitHub
parent 9ab5c45e3a
commit f1c9a4d1b9
+1 -22
View File
@@ -121,7 +121,7 @@ impl GatewayManager {
Ok(())
}
/// Stop a gateway and clear its pairings. Config is kept so it can be restarted.
/// Stop a gateway while preserving pairings so it can be restarted.
pub async fn stop_gateway(&self, gateway_type: &str) -> anyhow::Result<()> {
let instance = self
.gateways
@@ -133,20 +133,6 @@ impl GatewayManager {
instance.cancel.cancel();
let _ = instance.handle.await;
match self
.pairing_store
.remove_all_for_platform(gateway_type)
.await
{
Ok(count) if count > 0 => {
tracing::info!(gateway = %gateway_type, count, "cleared pairings on stop");
}
Err(e) => {
tracing::warn!(gateway = %gateway_type, error = %e, "failed to clear pairings on stop");
}
_ => {}
}
tracing::info!(gateway = %gateway_type, "gateway stopped");
Ok(())
}
@@ -239,13 +225,6 @@ impl GatewayManager {
for (gateway_type, instance) in instances {
instance.cancel.cancel();
let _ = instance.handle.await;
if let Err(e) = self
.pairing_store
.remove_all_for_platform(&gateway_type)
.await
{
tracing::warn!(gateway = %gateway_type, error = %e, "failed to clear pairings on stop");
}
tracing::info!(gateway = %gateway_type, "gateway stopped");
}
}