mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2025-12-14 00:14:31 +08:00
Clear filename list cache to allow rebuilding the list when the "/object_info" endpoint is called
This commit is contained in:
parent
329480da5a
commit
2043ca2b61
@ -137,6 +137,15 @@ def set_user_directory(user_dir: str) -> None:
|
|||||||
user_directory = user_dir
|
user_directory = user_dir
|
||||||
|
|
||||||
|
|
||||||
|
def clear_filename_list_cache() -> None:
|
||||||
|
"""
|
||||||
|
Clear cached filename lists so new files on disk are discovered.
|
||||||
|
"""
|
||||||
|
global filename_list_cache
|
||||||
|
filename_list_cache.clear()
|
||||||
|
cache_helper.clear()
|
||||||
|
|
||||||
|
|
||||||
# System User Protection - Protects system directories from HTTP endpoint access
|
# System User Protection - Protects system directories from HTTP endpoint access
|
||||||
# System Users are internal-only users that cannot be accessed via HTTP endpoints.
|
# System Users are internal-only users that cannot be accessed via HTTP endpoints.
|
||||||
# They use the '__' prefix convention (similar to Python's private member convention).
|
# They use the '__' prefix convention (similar to Python's private member convention).
|
||||||
|
|||||||
@ -676,6 +676,7 @@ class PromptServer():
|
|||||||
|
|
||||||
@routes.get("/object_info")
|
@routes.get("/object_info")
|
||||||
async def get_object_info(request):
|
async def get_object_info(request):
|
||||||
|
folder_paths.clear_filename_list_cache()
|
||||||
with folder_paths.cache_helper:
|
with folder_paths.cache_helper:
|
||||||
out = {}
|
out = {}
|
||||||
for x in nodes.NODE_CLASS_MAPPINGS:
|
for x in nodes.NODE_CLASS_MAPPINGS:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user