-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Feat/Bulk and selective log deletion #25019
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
Open
connermo
wants to merge
35
commits into
langgenius:main
Choose a base branch
from
connermo:feat/selective-log-deletion
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,399
−116
Open
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
ea0bc7d
feat: add selective log deletion functionality to improve log management
3237ed1
refactor: move conversation deletion to service layer with Celery tasks
0d1ba93
Fix conversation clearing and prevent 404 errors
642cd31
Merge upstream main and resolve conflicts
4e0979a
Optimize PR based on feedback - improve code quality and accessibility
8518150
Fix linter formatting issues
7870f70
Fix overly aggressive localStorage clearing - address PR feedback
5a7be42
Fix import error for CONVERSATION_ID_INFO constant
e774b84
Merge branch 'main' into feat/selective-log-deletion
crazywoola 1f305b2
[autofix.ci] apply automated fixes
autofix-ci[bot] f3d11cf
Simplify conversation deletion parameter parsing and resolve merge co…
connermo b014204
Fix merge conflict in imports: add missing Account import
connermo d6f2b70
Merge branch 'main' into feat/selective-log-deletion
crazywoola d2b90cc
Merge branch 'main' into feat/selective-log-deletion
connermo 19b38d8
Merge branch 'main' into feat/selective-log-deletion
crazywoola a2eba9a
[autofix.ci] apply automated fixes
autofix-ci[bot] a259b4c
Merge branch 'main' into feat/selective-log-deletion
asukaminato0721 034ce08
[autofix.ci] apply automated fixes
autofix-ci[bot] 41844ec
refactor: consolidate conversation deletion logic and fix critical is…
connermo c7d6d92
Merge upstream/main into feat/selective-log-deletion
connermo 31f6a06
fix: remove unused handleRowClick function
connermo ec9dc0a
fix: improve log clearing and prevent 404 errors
connermo 8da334c
feat: prevent duplicate log clearing tasks with Redis locks and optim…
connermo 5817c66
fix: enable auto-refresh for log list on focus and reconnect
connermo 6349de7
fix: implement optimistic updates for log deletion
connermo 1c7a4b6
fix: refresh log list when navigating from other pages
connermo f223eaa
fix: refresh conversation list when navigating to configuration page
connermo ce1f293
Merge branch 'main' into feat/selective-log-deletion
connermo f9f089c
fix: ensure conversation list refreshes after deletion in same tab
connermo b56b6d1
feat: implement universal conversation list sync mechanism
connermo 8ae7537
Merge upstream/main into feat/selective-log-deletion
connermo 43d6fb3
Merge upstream/main into feat/selective-log-deletion
connermo 1a19809
Merge branch 'main' into feat/selective-log-deletion
connermo 0983027
Merge branch 'main' into feat/selective-log-deletion
crazywoola 5bbd7b0
Merge branch 'main' into feat/selective-log-deletion
connermo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import logging | ||
|
|
||
| from celery import shared_task | ||
|
|
||
| from extensions.ext_database import db | ||
| from extensions.ext_storage import storage | ||
| from models.model import UploadFile | ||
|
|
||
| logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| @shared_task(queue="dataset") | ||
| def clean_uploaded_files_task(upload_file_ids: list[str]): | ||
| """ | ||
| Asynchronously clean uploaded files from storage. | ||
| This task is called after database records have been successfully deleted. | ||
|
|
||
| Args: | ||
| upload_file_ids: List of upload file IDs to delete from storage | ||
| """ | ||
| if not upload_file_ids: | ||
| return | ||
|
|
||
| success_count = 0 | ||
| failed_count = 0 | ||
|
|
||
| for upload_file_id in upload_file_ids: | ||
| try: | ||
| upload_file = db.session.query(UploadFile).where(UploadFile.id == upload_file_id).first() | ||
|
|
||
| if upload_file and upload_file.key: | ||
| storage.delete(upload_file.key) | ||
| success_count += 1 | ||
|
|
||
| except Exception: | ||
| logger.exception("Failed to delete upload file %s", upload_file_id) | ||
| failed_count += 1 | ||
|
|
||
| return {"total": len(upload_file_ids), "success": success_count, "failed": failed_count} | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.