Last active
July 17, 2020 05:54
-
-
Save efenfauzi/2c61f75c11768c0344441fb5fcd89217 to your computer and use it in GitHub Desktop.
test async with cron
This file contains hidden or 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
# from https://github.com/gawel/aiocron | |
import aiocron | |
import asyncio | |
# this cron execute every 1minute | |
@aiocron.crontab('*/1 * * * *') | |
async def func1(): | |
print ('Run Function 1') | |
# this cron execute every 5minute | |
@aiocron.crontab('*/5 * * * *') | |
async def func2(): | |
print ('Run Function 2') | |
asyncio.get_event_loop().run_forever() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment