diff --git a/src/core/error.rs b/src/core/error.rs index b45361c..2f86938 100644 --- a/src/core/error.rs +++ b/src/core/error.rs @@ -19,6 +19,9 @@ pub enum MemoryError { #[error("Configuration error: {0}")] Config(String), + + #[error("Parse error: {0}")] + Parse(String), } pub type Result = std::result::Result; diff --git a/src/core/store.rs b/src/core/store.rs index b9f5b04..537b10c 100644 --- a/src/core/store.rs +++ b/src/core/store.rs @@ -530,7 +530,7 @@ impl MemoryStore { .map_err(|e| MemoryError::Parse(e.to_string()))? .with_timezone(&Utc); - let age_minutes = (Utc::now() - cached_at).num_minutes(); + let age_minutes = (Utc::now() - cached_at).num_seconds() / 60; if age_minutes < Self::RELATIONSHIP_CACHE_DURATION_MINUTES { let relationship: super::relationship::RelationshipInference = @@ -582,7 +582,7 @@ impl MemoryStore { .map_err(|e| MemoryError::Parse(e.to_string()))? .with_timezone(&Utc); - let age_minutes = (Utc::now() - cached_at).num_minutes(); + let age_minutes = (Utc::now() - cached_at).num_seconds() / 60; if age_minutes < Self::RELATIONSHIP_CACHE_DURATION_MINUTES { let relationships: Vec = diff --git a/src/mcp/base.rs b/src/mcp/base.rs index e18ccc8..180db77 100644 --- a/src/mcp/base.rs +++ b/src/mcp/base.rs @@ -2,7 +2,7 @@ use anyhow::Result; use serde_json::{json, Value}; use std::io::{self, BufRead, Write}; -use crate::core::{Memory, MemoryStore, UserAnalysis, RelationshipInference, infer_all_relationships, get_relationship}; +use crate::core::{Memory, MemoryStore, UserAnalysis, infer_all_relationships, get_relationship}; pub struct BaseMCPServer { store: MemoryStore,