This repository has been archived by the owner on Jan 18, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0b39bec
commit 4f05f68
Showing
7 changed files
with
33 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,23 @@ | ||
from logging import getLogger | ||
from typing import Final, Self | ||
|
||
from aiohttp import ClientSession | ||
|
||
from check_phat_nguoi.config.config_reader import config | ||
|
||
logger = getLogger(__name__) | ||
|
||
|
||
class BaseNotificationEngine: | ||
timeout: Final[int] = config.request_timeout | ||
|
||
def __init__(self) -> None: | ||
self.session: ClientSession = ClientSession() | ||
logger.debug(f"Established notify engine session: {type(self).__name__}") | ||
|
||
async def __aenter__(self) -> Self: | ||
return self | ||
|
||
async def __aexit__(self, exc_type, exc_value, exc_traceback) -> None: | ||
logger.debug(f"Closed notify engine session: {type(self).__name__}") | ||
await self.session.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters