huskies: merge 655_bug_matrix_bot_spawns_its_own_timerstore_instead_of_using_shared_appcontext_timer_store

This commit is contained in:
dave
2026-04-27 11:28:21 +00:00
parent ac85cfce5d
commit 65d2fb210c
4 changed files with 14 additions and 10 deletions
+2 -3
View File
@@ -1,4 +1,5 @@
//! Matrix bot run loop — connects to the homeserver and processes sync events.
use crate::service::timer::TimerStore;
use crate::services::Services;
use crate::slog;
use matrix_sdk::ruma::OwnedRoomId;
@@ -28,6 +29,7 @@ pub async fn run_bot(
gateway_active_project: Option<Arc<RwLock<String>>>,
gateway_projects: Vec<String>,
gateway_project_urls: std::collections::BTreeMap<String, String>,
timer_store: Arc<TimerStore>,
) -> Result<(), String> {
let project_root = &services.project_root;
let store_path = project_root.join(".huskies").join("matrix_store");
@@ -224,9 +226,6 @@ pub async fn run_bot(
let announce_bot_name = services.bot_name.clone();
let timer_store = Arc::new(crate::service::timer::TimerStore::load(
project_root.join(".huskies").join("timers.json"),
));
// Auto-schedule timers when an agent hits a hard rate limit.
crate::service::timer::spawn_rate_limit_auto_scheduler(
Arc::clone(&timer_store),
+3
View File
@@ -32,6 +32,7 @@ pub use config::BotConfig;
use crate::io::watcher::WatcherEvent;
use crate::rebuild::ShutdownReason;
use crate::service::timer::TimerStore;
use crate::services::Services;
use std::path::Path;
use std::sync::Arc;
@@ -69,6 +70,7 @@ pub fn spawn_bot(
gateway_active_project: Option<Arc<RwLock<String>>>,
gateway_projects: Vec<String>,
gateway_project_urls: std::collections::BTreeMap<String, String>,
timer_store: Arc<TimerStore>,
) -> Option<tokio::task::AbortHandle> {
let config = match BotConfig::load(project_root) {
Some(c) => c,
@@ -105,6 +107,7 @@ pub fn spawn_bot(
gateway_active_project,
gateway_projects,
gateway_project_urls,
timer_store,
)
.await
{