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.
fix: re-organise to avoid config read related
- Loading branch information
1 parent
d407184
commit 11eca21
Showing
12 changed files
with
52 additions
and
47 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,3 @@ | ||
import asyncio | ||
from logging import getLogger | ||
from .config import ConfigDTO | ||
|
||
from truststore import inject_into_ssl | ||
|
||
from check_phat_nguoi.config_reader import config | ||
from check_phat_nguoi.get_data import GetData | ||
from check_phat_nguoi.notify import SendNotifications | ||
|
||
from .utils.setup_logger import setup_logger | ||
|
||
logger = getLogger(__name__) | ||
|
||
|
||
async def async_main() -> None: | ||
inject_into_ssl() | ||
setup_logger() | ||
logger.debug(f"Config read: {config}") | ||
await GetData().get_data() | ||
await SendNotifications().send() | ||
|
||
|
||
def main() -> None: | ||
asyncio.run(async_main()) | ||
|
||
|
||
__all__ = ["main"] | ||
__all__ = ["ConfigDTO"] |
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,6 +1,28 @@ | ||
from check_phat_nguoi import main | ||
import asyncio | ||
from logging import getLogger | ||
|
||
from truststore import inject_into_ssl | ||
|
||
from check_phat_nguoi.config.config_reader import config | ||
from check_phat_nguoi.get_data import GetData | ||
from check_phat_nguoi.notify import SendNotifications | ||
|
||
from .utils.setup_logger import setup_logger | ||
|
||
logger = getLogger(__name__) | ||
|
||
|
||
async def async_main() -> None: | ||
inject_into_ssl() | ||
setup_logger() | ||
logger.debug(f"Config read: {config}") | ||
await GetData().get_data() | ||
await SendNotifications().send() | ||
|
||
|
||
def main() -> None: | ||
asyncio.run(async_main()) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() | ||
|
||
__all__ = [] |
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
2 changes: 1 addition & 1 deletion
2
src/check_phat_nguoi/notify/markdown_message/markdown_message.py
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