Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix: stats cache TTL 24h instead of 1h — one DB query per day

Louis Beaumontf96066e20553
diff --git a/crates/screenpipe-engine/src/stats.rs b/crates/screenpipe-engine/src/stats.rs
index 22613e27e..8755999ad 100644
--- a/crates/screenpipe-engine/src/stats.rs
+++ b/crates/screenpipe-engine/src/stats.rs
@@ -12,8 +12,8 @@ use serde::{Deserialize, Serialize};
use tokio::sync::RwLock;
use tracing::debug;
-/// How long the cache is valid (1 hour).
-const CACHE_TTL_SECS: u64 = 3600;
+/// How long the cache is valid (24 hours).
+const CACHE_TTL_SECS: u64 = 86400;
/// Cached stats with timestamp.
static STATS_CACHE: std::sync::LazyLock<RwLock<(u64, Option<UserStats>)>> =