refac
This commit is contained in:
@@ -67,7 +67,7 @@ def get_function_module_by_id(request: Request, pipe_id: str):
|
|||||||
if valves:
|
if valves:
|
||||||
try:
|
try:
|
||||||
function_module.valves = Valves(
|
function_module.valves = Valves(
|
||||||
**{k: v for k, v in valves if v is not None}
|
**{k: v for k, v in valves.items() if v is not None}
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.exception(f"Error loading valves for function {pipe_id}: {e}")
|
log.exception(f"Error loading valves for function {pipe_id}: {e}")
|
||||||
|
|||||||
@@ -151,7 +151,9 @@ async def sync_functions(
|
|||||||
if hasattr(function_module, "Valves") and function.valves:
|
if hasattr(function_module, "Valves") and function.valves:
|
||||||
Valves = function_module.Valves
|
Valves = function_module.Valves
|
||||||
try:
|
try:
|
||||||
Valves(**{k: v for k, v in function.valves if v is not None})
|
Valves(
|
||||||
|
**{k: v for k, v in function.valves.items() if v is not None}
|
||||||
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.exception(
|
log.exception(
|
||||||
f"Error validating valves for function {function.id}: {e}"
|
f"Error validating valves for function {function.id}: {e}"
|
||||||
|
|||||||
Reference in New Issue
Block a user