-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
feat: Add database cleanup functions for transactions and vertex builds #4694
Merged
Conversation
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
dosubot
bot
added
size:M
This PR changes 30-99 lines, ignoring generated files.
enhancement
New feature or request
labels
Nov 19, 2024
github-actions
bot
added
enhancement
New feature or request
and removed
enhancement
New feature or request
labels
Nov 19, 2024
CodSpeed Performance ReportMerging #4694 will degrade performances by 95.84%Comparing Summary
Benchmarks breakdown
|
cbornet
reviewed
Nov 19, 2024
ogabrielluiz
force-pushed
the
transaction-vb-limit
branch
from
November 19, 2024 13:12
da97ddb
to
0500e74
Compare
ogabrielluiz
force-pushed
the
transaction-vb-limit
branch
from
November 19, 2024 13:33
0500e74
to
092d899
Compare
cbornet
reviewed
Nov 19, 2024
cbornet
reviewed
Nov 19, 2024
ogabrielluiz
force-pushed
the
transaction-vb-limit
branch
from
November 19, 2024 15:46
092d899
to
b0a9ee9
Compare
ogabrielluiz
force-pushed
the
transaction-vb-limit
branch
from
November 19, 2024 20:02
13836f3
to
f551209
Compare
cbornet
approved these changes
Nov 19, 2024
ogabrielluiz
force-pushed
the
transaction-vb-limit
branch
from
November 19, 2024 21:23
f551209
to
6217a34
Compare
…atabase - 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.
- 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.
ogabrielluiz
force-pushed
the
transaction-vb-limit
branch
from
November 19, 2024 21:53
88cdeaf
to
dc4f6ba
Compare
mieslep
pushed a commit
to mieslep/langflow
that referenced
this pull request
Nov 22, 2024
…ds (langflow-ai#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.
diogocabral
pushed a commit
to headlinevc/langflow
that referenced
this pull request
Nov 26, 2024
…ds (langflow-ai#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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
New feature or request
lgtm
This PR has been approved by a maintainer
size:M
This PR changes 30-99 lines, ignoring generated files.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces functions to clean up old transactions and vertex builds in the database, ensuring that only a configured maximum number of each is retained. The
clean_transactions
function deletes transactions exceeding the specified limit, whileclean_vertex_builds
performs a similar cleanup for vertex builds. Additionally, these cleanup functions are integrated into the service initialization process, and new configuration options for maximum retention limits have been added.