ragflow/api
lgphone 7f80d7304d
Fix: Optimized the get_by_id method to resolve the issue of missing exceptions and improve query performance (#6320)
Fix: Optimized the get_by_id method to resolve the issue of missing
exceptions and improve query performance

### What problem does this PR solve?

Optimized the get_by_id method to resolve the issue of missing
exceptions and improve query performance.
Optimization details:
1. The original method used a custom query method that required
concatenating SQL, which impacted performance.
2. The query method returned a list, which needed to be accessed by
index, posing a risk of index out-of-bounds errors.
3. The original method used except Exception to catch all errors, which
is not a best practice in Python programming and may lead to missing
exceptions. The get_or_none method accurately catches DoesNotExist
errors while allowing other errors to be raised normally.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
- [x] Performance Improvement
2025-03-20 23:23:48 +08:00
..
apps Fix(api): correct document parsing progress check logic (#6318) 2025-03-20 16:00:17 +08:00
db Fix: Optimized the get_by_id method to resolve the issue of missing exceptions and improve query performance (#6320) 2025-03-20 23:23:48 +08:00
utils Fix: #5719 Added type check for parser_config (#6243) 2025-03-18 18:40:06 +08:00
__init__.py Update comments (#4569) 2025-01-21 20:52:28 +08:00
constants.py Add more web test cases (#3702) 2024-11-28 15:46:35 +08:00
ragflow_server.py Fix update_progress (#6340) 2025-03-20 17:01:28 +08:00
settings.py Fix: Reduce excessive IO operations by loading LLM factory configurations (#6047) 2025-03-14 09:54:38 +08:00
validation.py Fix errors detected by Ruff (#3918) 2024-12-08 14:21:12 +08:00
versions.py Fix VERSION 2024-12-07 16:56:34 +08:00