Make /sync respond early on server shutdown

This commit is contained in:
dasha_uwu
2025-08-28 23:09:49 +05:00
committed by Jason Volk
parent d8e6d95f4b
commit 33a16f4831

View File

@@ -177,7 +177,7 @@ pub(crate) async fn sync_events_route(
}
// Wait for activity
if time::timeout_at(stop_at, watchers).await.is_err() {
if time::timeout_at(stop_at, watchers).await.is_err() || services.server.is_stopping() {
trace!(since, next_batch, "empty response");
return Ok(sync_events::v3::Response::new(next_batch.to_string()));
}