Files
zesdex/apps/infrastructure/src/review/staleness.rs
T
asepharyana da2ed6da25 feat(tui): add usage overlay and sidebar for displaying usage statistics and tasks
feat(tui): implement status bar with connection and turn state indicators
feat(tui): create workflow panel for agent status and progress visualization
feat(web): introduce web frontend interface with static file serving
feat(ws): add WebSocket interface for real-time communication and session management
2026-07-20 09:04:57 +07:00

16 lines
493 B
Rust

//! Staleness detection for lesson cache entries.
use std::time::{SystemTime, UNIX_EPOCH};
/// How long (in seconds) before a lesson is considered stale.
const STALE_THRESHOLD_SECS: u64 = 86400 * 7; // 7 days
/// Check whether a lesson timestamp is stale.
pub fn is_stale(updated_at: i64) -> bool {
let now = SystemTime::now()
.duration_since(UNIX_EPOCH)
.unwrap_or_default()
.as_secs() as i64;
now.saturating_sub(updated_at) > STALE_THRESHOLD_SECS as i64
}