f
This commit is contained in:
@@ -86,9 +86,22 @@ class Get_File(sh.Cmdlet):
|
||||
|
||||
debug(f"[get-file] Getting storage backend: {store_name}")
|
||||
|
||||
# Get storage backend
|
||||
store = Store(config)
|
||||
backend = store[store_name]
|
||||
# Prefer instantiating only the named backend to avoid initializing all configured backends
|
||||
try:
|
||||
from Store.registry import get_backend_instance
|
||||
backend = get_backend_instance(config, store_name, suppress_debug=True)
|
||||
except Exception:
|
||||
backend = None
|
||||
|
||||
if backend is None:
|
||||
# Fallback to full registry when targeted instantiation fails
|
||||
try:
|
||||
store = Store(config)
|
||||
backend = store[store_name]
|
||||
except Exception:
|
||||
log(f"Error: Storage backend '{store_name}' not found", file=sys.stderr)
|
||||
return 1
|
||||
|
||||
debug(f"[get-file] Backend retrieved: {type(backend).__name__}")
|
||||
|
||||
# Get file metadata to determine name and extension
|
||||
|
||||
Reference in New Issue
Block a user