huskies: merge 1132 story Chat-bot proxy reads stale gateway_project_urls BTreeMap instead of live store (1122 missed this seam)
This commit is contained in:
@@ -28,7 +28,6 @@ pub async fn run_bot(
|
||||
watcher_tx: tokio::sync::broadcast::Sender<crate::io::watcher::WatcherEvent>,
|
||||
shutdown_rx: watch::Receiver<Option<crate::rebuild::ShutdownReason>>,
|
||||
gateway_active_project: Option<Arc<RwLock<String>>>,
|
||||
gateway_project_urls: std::collections::BTreeMap<String, String>,
|
||||
gateway_projects_store: Option<
|
||||
Arc<
|
||||
RwLock<
|
||||
@@ -182,7 +181,17 @@ pub async fn run_bot(
|
||||
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 = gateway_project_urls.clone();
|
||||
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;
|
||||
|
||||
@@ -321,7 +330,6 @@ pub async fn run_bot(
|
||||
transport: Arc::clone(&transport),
|
||||
timer_store,
|
||||
gateway_active_project,
|
||||
gateway_project_urls,
|
||||
gateway_projects_store,
|
||||
handled_incoming_event_ids: Arc::new(TokioMutex::new(super::context::SeenEventIds::new(
|
||||
super::context::SEEN_EVENT_IDS_CAP,
|
||||
|
||||
Reference in New Issue
Block a user