added support for passing proxy path location depending on which env used
This commit is contained in:
1 parent
dcc4f58292
commit
a61dbdfaa9
1 file changed
+4
-1
@@ -37,9 +37,11 @@ LOGGER = logging.getLogger(__name__)
|
||||
def init_monitor(
|
||||
monitor_name: str,
|
||||
development_mode: DevelopmentMode,
|
||||
proxy_path: str,
|
||||
production_proxy_path: str = "proxies.txt",
|
||||
testing_proxy_path: str = "configs/proxies.txt",
|
||||
logging_level=LOGGING_LEVEL,
|
||||
) -> tuple[list[str], AsyncIOMotorCollection, AioProxies]:
|
||||
use_production = is_production(development_mode)
|
||||
setup_logging(
|
||||
name="logs/latest.log",
|
||||
history_name=monitor_name,
|
||||
@@ -50,6 +52,7 @@ def init_monitor(
|
||||
category_names, _, collection = setup_config(
|
||||
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)
|
||||
return category_names, collection, proxies
|
||||
|
||||
|
||||
Reference in new issue
Block a user