Merge pull request #4 from syui/claude/ai-memory-system-011CUps6H1mBNe6zxKdkcyUj
Fix compilation errors in Layer 4 caching
This commit is contained in:
@@ -19,6 +19,9 @@ pub enum MemoryError {
|
||||
|
||||
#[error("Configuration error: {0}")]
|
||||
Config(String),
|
||||
|
||||
#[error("Parse error: {0}")]
|
||||
Parse(String),
|
||||
}
|
||||
|
||||
pub type Result<T> = std::result::Result<T, MemoryError>;
|
||||
|
||||
@@ -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<super::relationship::RelationshipInference> =
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user