mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #5160] [MERGED] fix: avoid overriding DATA_DIR and prevent errors when directories are the same #8429
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/5160
Author: @vikrantrathore
Created: 9/5/2024
Status: ✅ Merged
Merged: 9/5/2024
Merged by: @tjbck
Base:
main← Head:main📝 Commits (2)
74169b0fix: avoid overriding DATA_DIR and prevent errors when directories are the same85fc354refac📊 Changes
1 file changed (+3 additions, -2 deletions)
View changed files
📝
backend/open_webui/env.py(+3 -2)📄 Description
Changelog Entry
Description
Previously, the
DATA_DIRenvironment variable was always overridden by defaulting toOPEN_WEBUI_DIR / "data", which ignored user-definedDATA_DIRvalues. Additionally, whenDATA_DIRandNEW_DATA_DIRwere the same, the script attempted to copy files into themselves, leading to errors or redundant operations.This commit ensures that:
DATA_DIRenvironment variable is respected and not overridden.DATA_DIRandNEW_DATA_DIRare only performed if the directories are different, preventing errors when they point to the same location.These changes resolve potential file copy errors and preserve user configurations.
Fixed
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.