From fdf037b3d0117bd29f0c541ed027895c070678df Mon Sep 17 00:00:00 2001 From: chinu0609 Date: Thu, 6 Nov 2025 23:00:56 +0530 Subject: [PATCH] fix: min to days --- cognee/tasks/cleanup/cleanup_unused_data.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cognee/tasks/cleanup/cleanup_unused_data.py b/cognee/tasks/cleanup/cleanup_unused_data.py index c9c711fe2..4df622a2c 100644 --- a/cognee/tasks/cleanup/cleanup_unused_data.py +++ b/cognee/tasks/cleanup/cleanup_unused_data.py @@ -23,7 +23,7 @@ logger = get_logger(__name__) async def cleanup_unused_data( - minutes_threshold: int = 30, + days_threshold: Optional[int], dry_run: bool = True, user_id: Optional[UUID] = None, text_doc: bool = False @@ -33,8 +33,8 @@ async def cleanup_unused_data( Parameters ---------- - minutes_threshold : int - Minutes since last access to consider data unused (default: 30) + days_threshold : int + days since last access to consider data unused dry_run : bool If True, only report what would be deleted without actually deleting (default: True) user_id : UUID, optional @@ -50,14 +50,14 @@ async def cleanup_unused_data( """ logger.info( "Starting cleanup task", - minutes_threshold=minutes_threshold, + days_threshold=days_threshold, dry_run=dry_run, user_id=str(user_id) if user_id else None, text_doc=text_doc ) # Calculate cutoff timestamp - cutoff_date = datetime.now(timezone.utc) - timedelta(minutes=minutes_threshold) + cutoff_date = datetime.now(timezone.utc) - timedelta(days=days_threshold) if text_doc: # SQL-based approach: Find unused TextDocuments and use cognee.delete()