mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-17 08:21:12 -05:00
[PR #11160] [CLOSED] chore: Improve config.json migration #61527
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/11160
Author: @tidely
Created: 3/4/2025
Status: ❌ Closed
Base:
dev← Head:configmigrate📝 Commits (3)
3e8a115chore: improve config.json migrationf5422ecchore: remove unused importsce70139Revert "chore: remove unused imports"📊 Changes
1 file changed (+13 additions, -10 deletions)
View changed files
📝
backend/open_webui/config.py(+13 -10)📄 Description
Description
Fixed a Time-of-Check Time-of-Use (TOCTOU) bug by handling exceptions instead of checking for a file existing beforehand. While this is extremely unlikely to occur naturally we should fix it anyway.
load_json_configwas only being used by the migration, so we can remove it.We previously saved the loaded config in the
datavariable. This has a global scope and would not get removed by the gc. We can fix this by moving the migration into its own function.Future
We should probably add a comment on how long of a migration period we want to have. This project moves very fast and the migration started 7 months ago already.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.