-
Notifications
You must be signed in to change notification settings - Fork 64
Add an option to schedule database cleanup. #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…in intact and are not fragmented.
- Fixes the MDB_MAP_FULL error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements automatic cleanup of expired conversations in the LMDB storage based on a configurable retention period. The retention policy helps manage storage space by removing old conversations after a specified number of days.
- Adds a
retention_daysconfiguration parameter with a default of 14 days - Implements a
cleanup_expired()method inLMDBConversationStoreto delete old conversations - Introduces a background task that runs every 6 hours to enforce the retention policy
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| config/config.yaml | Increased max database size to 256 MB and added retention_days: 14 configuration |
| app/utils/config.py | Added retention_days field to StorageConfig model with default value of 14 days |
| app/services/lmdb.py | Added retention_days parameter to constructor and implemented cleanup_expired() method |
| app/main.py | Added background task _run_retention_cleanup() that periodically calls cleanup with 6-hour intervals |
Comments suppressed due to low confidence (1)
app/services/lmdb.py:53
- The docstring mentions default of 128MB but the code has been updated to use 256MB. Update the documentation to reflect the new default value of 256MB.
max_db_size: Maximum database size in bytes (default: 128MB)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…nly instead of an image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Update: