added support for passing proxy path location depending on which env used

This commit is contained in:
tpv committed 2026-07-02 12:49:41 -07:00
1 parent dcc4f58292
commit a61dbdfaa9
1 file changed
+4 -1
+4 -1
View File
@@ -37,9 +37,11 @@ LOGGER = logging.getLogger(__name__)
def init_monitor( def init_monitor(
monitor_name: str, monitor_name: str,
development_mode: DevelopmentMode, development_mode: DevelopmentMode,
proxy_path: str, production_proxy_path: str = "proxies.txt",
testing_proxy_path: str = "configs/proxies.txt",
logging_level=LOGGING_LEVEL, logging_level=LOGGING_LEVEL,
) -> tuple[list[str], AsyncIOMotorCollection, AioProxies]: ) -> tuple[list[str], AsyncIOMotorCollection, AioProxies]:
use_production = is_production(development_mode)
setup_logging( setup_logging(
name="logs/latest.log", name="logs/latest.log",
history_name=monitor_name, history_name=monitor_name,
@@ -50,6 +52,7 @@ def init_monitor(
category_names, _, collection = setup_config( category_names, _, collection = setup_config(
monitor_name=monitor_name, development_mode=development_mode monitor_name=monitor_name, development_mode=development_mode
) )
proxy_path = production_proxy_path if use_production else testing_proxy_path
proxies = AioProxies.from_file(path=proxy_path) proxies = AioProxies.from_file(path=proxy_path)
return category_names, collection, proxies return category_names, collection, proxies