huskies: merge 1180 story Sled↔gateway goes WS-only: remove the deprecated HTTP fallback paths
This commit is contained in:
@@ -190,21 +190,6 @@ pub async fn run_bot(
|
||||
let notif_room_ids = target_room_ids.clone();
|
||||
let notif_project_root = project_root.clone();
|
||||
let announce_room_ids = target_room_ids.clone();
|
||||
// Clone values needed by the gateway notification poller (only used in gateway mode).
|
||||
let poller_room_ids: Vec<String> = target_room_ids.iter().map(|r| r.to_string()).collect();
|
||||
let poller_project_urls: std::collections::BTreeMap<String, String> =
|
||||
if let Some(ref store) = gateway_projects_store {
|
||||
store
|
||||
.read()
|
||||
.await
|
||||
.iter()
|
||||
.filter_map(|(name, entry)| entry.url.clone().map(|url| (name.clone(), url)))
|
||||
.collect()
|
||||
} else {
|
||||
std::collections::BTreeMap::new()
|
||||
};
|
||||
let poller_poll_interval = config.aggregated_notifications_poll_interval_secs;
|
||||
let poller_enabled = config.aggregated_notifications_enabled;
|
||||
|
||||
let persisted = load_history(project_root);
|
||||
slog!(
|
||||
@@ -371,21 +356,9 @@ pub async fn run_bot(
|
||||
notif_project_root,
|
||||
);
|
||||
|
||||
// In gateway mode, spawn the cross-project notification poller.
|
||||
// It polls every registered project's `/api/events` endpoint and forwards
|
||||
// new events to the configured gateway rooms with a `[project-name]` prefix.
|
||||
// The poller is controlled by the gateway-level `aggregated_notifications_enabled`
|
||||
// flag in bot.toml — set it to `false` to disable without touching per-project configs.
|
||||
if !poller_project_urls.is_empty() && poller_enabled {
|
||||
crate::gateway::spawn_gateway_notification_poller(
|
||||
Arc::clone(&transport),
|
||||
poller_room_ids,
|
||||
poller_project_urls,
|
||||
poller_poll_interval,
|
||||
);
|
||||
}
|
||||
|
||||
// Forwarder task: post gateway events to Matrix rooms with `[project-name]` prefix.
|
||||
// Project nodes push events over the WS uplink (story 899/1179); the
|
||||
// gateway no longer polls per-project `/api/events` over HTTP (story 1180).
|
||||
if let Some(event_rx) = gateway_event_rx_for_forwarder {
|
||||
let broadcast_room_ids: Vec<String> =
|
||||
announce_room_ids.iter().map(|r| r.to_string()).collect();
|
||||
|
||||
Reference in New Issue
Block a user