huskies: merge 1122 story Chat-bot switch command reads stale gateway_projects Vec instead of live gateway_projects_store
This commit is contained in:
@@ -504,7 +504,6 @@ pub type ActiveProject = std::sync::Arc<tokio::sync::RwLock<String>>;
|
||||
pub fn spawn_gateway_bot(
|
||||
config_dir: &Path,
|
||||
active_project: ActiveProject,
|
||||
gateway_projects: Vec<String>,
|
||||
gateway_project_urls: BTreeMap<String, String>,
|
||||
gateway_projects_store: std::sync::Arc<tokio::sync::RwLock<BTreeMap<String, ProjectEntry>>>,
|
||||
port: u16,
|
||||
@@ -578,7 +577,6 @@ pub fn spawn_gateway_bot(
|
||||
services,
|
||||
shutdown_rx,
|
||||
Some(active_project),
|
||||
gateway_projects,
|
||||
gateway_project_urls,
|
||||
Some(gateway_projects_store),
|
||||
timer_store,
|
||||
@@ -610,7 +608,6 @@ mod tests {
|
||||
let (handle, shutdown_tx) = spawn_gateway_bot(
|
||||
tmp.path(),
|
||||
active,
|
||||
vec!["proj".to_string()],
|
||||
std::collections::BTreeMap::new(),
|
||||
projects_store,
|
||||
3001,
|
||||
|
||||
@@ -647,7 +647,6 @@ pub async fn save_bot_config_and_restart(state: &GatewayState, content: &str) ->
|
||||
if let Some(h) = handle.take() {
|
||||
h.abort();
|
||||
}
|
||||
let gateway_projects: Vec<String> = state.projects.read().await.keys().cloned().collect();
|
||||
let gateway_project_urls: BTreeMap<String, String> = state
|
||||
.projects
|
||||
.read()
|
||||
@@ -659,7 +658,6 @@ pub async fn save_bot_config_and_restart(state: &GatewayState, content: &str) ->
|
||||
let (new_handle, new_shutdown_tx) = io::spawn_gateway_bot(
|
||||
&state.config_dir,
|
||||
Arc::clone(&state.active_project),
|
||||
gateway_projects,
|
||||
gateway_project_urls,
|
||||
Arc::clone(&state.projects),
|
||||
state.port,
|
||||
|
||||
Reference in New Issue
Block a user