huskies: merge 1149 story huskies health chat command — surface gateway, sled, matrix, creds, and build-hash status
This commit is contained in:
@@ -6,6 +6,7 @@ use crate::services::Services;
|
||||
use matrix_sdk::ruma::{OwnedEventId, OwnedRoomId, OwnedUserId};
|
||||
use std::collections::{BTreeMap, HashSet, VecDeque};
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::AtomicI64;
|
||||
use tokio::sync::Mutex as TokioMutex;
|
||||
use tokio::sync::RwLock;
|
||||
|
||||
@@ -104,6 +105,10 @@ pub struct BotContext {
|
||||
/// Used by the "rebuild gateway" command to construct the health-check URL
|
||||
/// passed to the trampoline. `None` in standalone single-project mode.
|
||||
pub gateway_port: Option<u16>,
|
||||
/// Timestamp (ms since Unix epoch) of the last Matrix event received in any
|
||||
/// configured room. Updated atomically on every `on_room_message` call so
|
||||
/// the `health` command can detect a stale or dead sync loop.
|
||||
pub last_matrix_event_ms: Arc<AtomicI64>,
|
||||
}
|
||||
|
||||
impl BotContext {
|
||||
@@ -299,6 +304,7 @@ mod tests {
|
||||
SEEN_EVENT_IDS_CAP,
|
||||
))),
|
||||
gateway_port: None,
|
||||
last_matrix_event_ms: Arc::new(AtomicI64::new(chrono::Utc::now().timestamp_millis())),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user