Skip to content

Instantly share code, notes, and snippets.

@efenfauzi
Last active July 17, 2020 05:54
Show Gist options
  • Save efenfauzi/2c61f75c11768c0344441fb5fcd89217 to your computer and use it in GitHub Desktop.
Save efenfauzi/2c61f75c11768c0344441fb5fcd89217 to your computer and use it in GitHub Desktop.
test async with cron
# 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