-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
5 changed files
with
66 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
""" | ||
TODO : 추후 배치잡이 많아지거나 부하가 심하다고 판단되면 pod를 분리한다. | ||
""" | ||
|
||
import asyncio | ||
|
||
from schedule import Scheduler | ||
|
||
from waffledotcom.src.batch.slack.main import main as slack_main | ||
from waffledotcom.src.settings import settings | ||
|
||
|
||
async def schedule_tasks(): | ||
scheduler = Scheduler() | ||
if settings.is_dev: | ||
scheduler.every().day.at("00:00", "Asia/Seoul").do(slack_main) | ||
if settings.is_prod: | ||
scheduler.every().sunday.at("00:00", "Asia/Seoul").do(slack_main) | ||
while True: | ||
# 최소 주기를 60초로 설정 | ||
await asyncio.sleep(10) | ||
scheduler.run_pending() |
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