Skip to content
This repository has been archived by the owner on Jan 18, 2025. It is now read-only.

Commit

Permalink
refactor: timeout to constant
Browse files Browse the repository at this point in the history
  • Loading branch information
NTGNguyen committed Jan 4, 2025
1 parent e6616fb commit d89cff4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/check_phat_nguoi/get_data/check_phat_nguoi.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@


class GetDataCheckPhatNguoi(GetDataBase):
# TODO: Refactor timeout to constant
def __init__(
self, plate_infos: tuple[PlateInfoDTO, ...], timeout: int = 10
) -> None:
Expand Down
8 changes: 2 additions & 6 deletions src/check_phat_nguoi/notify/telegram.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,15 @@
class Telegram(NotificationEngine):
# FIXME: The message_dict is so ... bruh
def __init__(
self,
telegram: TelegramDTO,
messages: tuple[MessagesModel, ...],
self, telegram: TelegramDTO, messages: tuple[MessagesModel, ...], timeout=10
):
self._telegram: TelegramDTO = telegram
self._messages: tuple[MessagesModel, ...] = messages
# FIXME: Heyyyyy refactor timeout hehe
self.timeout = 10
self.timeout = timeout
self.session: ClientSession = ClientSession()

async def _send_message(self, message: str, plate: str) -> None:
# FIXME: specify which plate is successfully send, or fail
# FIXME: use fstring instead of string format
url = API_URL.format(bot_token=self._telegram.bot_token)
payload = {
"chat_id": self._telegram.chat_id,
Expand Down

0 comments on commit d89cff4

Please sign in to comment.