From 13933f35f251cf47187c2c2145ac7b176ce8f41a Mon Sep 17 00:00:00 2001 From: jstzwj <1103870790@qq.com> Date: Fri, 16 Aug 2024 01:44:20 +0800 Subject: [PATCH] update meta and tree apis --- olah/proxy/meta.py | 8 ++++---- olah/proxy/tree.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/olah/proxy/meta.py b/olah/proxy/meta.py index 9d210d0..f661d52 100644 --- a/olah/proxy/meta.py +++ b/olah/proxy/meta.py @@ -20,7 +20,7 @@ from olah.utils.file_utils import make_dirs -async def meta_cache_generator(app: FastAPI, save_path: str): +async def _meta_cache_generator(save_path: str): yield {} with open(save_path, "rb") as f: while True: @@ -72,7 +72,7 @@ async def meta_proxy_cache( ) -async def meta_proxy_generator( +async def _meta_proxy_generator( app: FastAPI, headers: Dict[str, str], meta_url: str, @@ -132,10 +132,10 @@ async def meta_generator( ) # proxy if use_cache: - async for item in meta_cache_generator(app, save_path): + async for item in _meta_cache_generator(save_path): yield item else: - async for item in meta_proxy_generator( + async for item in _meta_proxy_generator( app, headers, meta_url, allow_cache, save_path ): yield item diff --git a/olah/proxy/tree.py b/olah/proxy/tree.py index 875930d..963125c 100644 --- a/olah/proxy/tree.py +++ b/olah/proxy/tree.py @@ -20,7 +20,7 @@ from olah.utils.file_utils import make_dirs -async def tree_cache_generator(save_path: str): +async def _tree_cache_generator(save_path: str): yield {} with open(save_path, "rb") as f: while True: @@ -70,7 +70,7 @@ async def tree_proxy_cache( ) -async def tree_proxy_generator( +async def _tree_proxy_generator( app: FastAPI, headers: Dict[str, str], tree_url: str, @@ -128,10 +128,10 @@ async def tree_generator( ) # proxy if use_cache: - async for item in tree_cache_generator(app, save_path): + async for item in _tree_cache_generator(save_path): yield item else: - async for item in tree_proxy_generator( + async for item in _tree_proxy_generator( app, headers, tree_url, allow_cache, save_path ): yield item