mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-07 02:58:21 +00:00
* perf(channels): batch user lookup in model_response_handler thread history The thread-history builder in model_response_handler called Users.get_user_by_id once per thread message (deduped via an intra-loop dict), producing N individual SELECTs for a thread of N unique authors. Replace with a single Users.get_users_by_user_ids call that returns all authors in one WHERE id IN (...) query, matching the batch pattern already used elsewhere in this file (lines 739, 804, 1320). Behavior is preserved: deleted users still resolve to None and fall through to the existing 'Unknown' fallback via .get(). * refac(channels): rename loop vars to full words per review Address reviewer feedback to use descriptive names `message` and `user` instead of single-letter `m` and `u` in the batch user-lookup comprehensions. --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| data | ||
| internal | ||
| migrations | ||
| models | ||
| retrieval | ||
| routers | ||
| socket | ||
| static | ||
| storage | ||
| test | ||
| tools | ||
| utils | ||
| __init__.py | ||
| alembic.ini | ||
| config.py | ||
| constants.py | ||
| env.py | ||
| functions.py | ||
| main.py | ||
| tasks.py | ||