增加定时器 demo code

This commit is contained in:
BryantHe 2023-05-24 00:39:41 +08:00
parent c2743784cb
commit 38af7619c2
2 changed files with 14 additions and 0 deletions

View File

@ -50,5 +50,6 @@ setup(
'request-id==1.0.1', 'request-id==1.0.1',
'nameko-sentry==1.0.0', 'nameko-sentry==1.0.0',
'pyopenssl==23.1.1', 'pyopenssl==23.1.1',
'rocketry==2.4.0'
], ],
) )

13
timer_demo/timer.py Normal file
View File

@ -0,0 +1,13 @@
from rocketry import Rocketry
from rocketry.conds import daily
app = Rocketry()
@app.task(daily)
def do_daily():
print('日常任务')
if __name__ == '__main__':
app.run()