remove driver load from get id

This commit is contained in:
Dmitry Afanasyev 2022-08-26 20:53:51 +03:00
parent 4d6dbf60d8
commit f9c4da89a9
2 changed files with 0 additions and 7 deletions

View File

@ -4,7 +4,6 @@ from aiogram import Bot, types
from aiogram.contrib.middlewares.logging import LoggingMiddleware from aiogram.contrib.middlewares.logging import LoggingMiddleware
from aiogram.dispatcher import Dispatcher from aiogram.dispatcher import Dispatcher
from aiogram.utils.callback_data import CallbackData from aiogram.utils.callback_data import CallbackData
from app.core.logger import logger
from app.core.parse_web import get_driver, get_ttl_hash, parse_site from app.core.parse_web import get_driver, get_ttl_hash, parse_site
from app.settings import TELEGRAM_API_TOKEN from app.settings import TELEGRAM_API_TOKEN
@ -69,8 +68,6 @@ async def office_home(
@dispatcher.message_handler(commands=['chatid']) @dispatcher.message_handler(commands=['chatid'])
async def chat_id(message: types.Message) -> types.Message: async def chat_id(message: types.Message) -> types.Message:
driver = get_driver(ttl_hash=get_ttl_hash())
logger.info(driver.session_id)
return await bot.send_message(message.chat.id, message.chat.id) return await bot.send_message(message.chat.id, message.chat.id)

View File

@ -103,7 +103,3 @@ def get_driver(ttl_hash: int | None = None) -> RemoteWebDriver:
command_executor='http://selenoid_host:4444/wd/hub', options=opt command_executor='http://selenoid_host:4444/wd/hub', options=opt
) )
return driver return driver
def get_driver_session(driver: RemoteWebDriver) -> str:
return driver.session_id # type: ignore