mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-12 02:06:37 +08:00
fix(storage): apply driver switch on save and repoint upload records
Saving storage settings now activates the selected driver immediately
instead of staging it until migration. When the driver changes, existing
upload rows are repointed to the new storage_driver so /f/{id} reads use
the correct backend. ForDriver can also open non-active drivers from the
saved multi-backend config.
This commit is contained in:
@@ -310,10 +310,6 @@ func validateAndMergeStorageConfig(ctx context.Context, value string, currentCon
|
||||
if err := validateMergedStorageConfig(ctx, currentCfg, newCfg, targetCfg); err != nil {
|
||||
return "", err
|
||||
}
|
||||
if newCfg.Driver != "" && newCfg.Driver != currentCfg.Driver {
|
||||
// 切换存储类型时仅暂存目标后端参数,活动 driver 由迁移任务正式切换。
|
||||
targetCfg.Driver = currentCfg.Driver
|
||||
}
|
||||
|
||||
// 序列化为最终保存的真实明文配置,防止保存屏蔽的 ****** 字符
|
||||
unmaskedVal, err := json.Marshal(targetCfg)
|
||||
|
||||
Reference in New Issue
Block a user