-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add database cleanup functions for transactions and vertex buil…
…ds (#4694) * feat: Add configuration options for maximum transactions and vertex builds retention * Add functions to clean up old transactions and vertex builds in the database - Implement `clean_transactions` to delete transactions exceeding the configured limit. - Implement `clean_vertex_builds` to delete vertex builds exceeding the configured limit. - Integrate cleanup functions into the service initialization process. * Add error handling and logging for cleanup tasks in utils.py - Wrap transaction and vertex build cleanup operations in try-except blocks. - Log success and error messages for cleanup operations. - Rollback session on exceptions without re-raising, as these are cleanup tasks. - Adjust service initialization order to ensure proper setup. * Reorder setup and cleanup tasks in database initialization process * fix: Update type hints for settings_service in cleanup functions * Remove execution options in cleanup functions * Handle specific exceptions during cleanup tasks in utils.py * Use `col` for column references in delete statements to improve SQL query clarity.
- Loading branch information
1 parent
ebe4f34
commit a0acf39
Showing
2 changed files
with
85 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters