mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-05 23:26:38 +08:00
refactor(storage): drop per-upload storage_driver, use storage_config as single source
Remove w_uploads.storage_driver and route all read/write/delete paths through storage.Active() backed by storage_config.driver. Block direct driver switches when uploads exist; require migration task instead. Simplify migration to cursor-based file_path iteration without per-row driver updates.
This commit is contained in:
@@ -70,16 +70,7 @@ func TestStorageCache(t *testing.T) {
|
||||
t.Errorf("Active returned driver %v, backend %v; expected %v, %v", drv, bnd, DriverLocal, mockBnd)
|
||||
}
|
||||
|
||||
// 5. Test ForDriver returns cached backend
|
||||
bnd2, err := ForDriver(ctx, DriverLocal)
|
||||
if err != nil {
|
||||
t.Fatalf("ForDriver failed: %v", err)
|
||||
}
|
||||
if bnd2 != mockBnd {
|
||||
t.Errorf("ForDriver returned backend %v, expected %v", bnd2, mockBnd)
|
||||
}
|
||||
|
||||
// 6. Test ResetCache again
|
||||
// 5. Test ResetCache again
|
||||
ResetCache()
|
||||
if activeConfigJSON != "" || activeDriver != "" || activeBackend != nil || !lastChecked.IsZero() {
|
||||
t.Fatal("ResetCache did not clear cache variables after setting them")
|
||||
|
||||
Reference in New Issue
Block a user