mirror of
https://gitea.bearcatlog.com/Bryant/chassis
synced 2025-01-19 03:12:47 +08:00
增加定时器 demo code
This commit is contained in:
parent
c2743784cb
commit
38af7619c2
1
setup.py
1
setup.py
@ -50,5 +50,6 @@ setup(
|
||||
'request-id==1.0.1',
|
||||
'nameko-sentry==1.0.0',
|
||||
'pyopenssl==23.1.1',
|
||||
'rocketry==2.4.0'
|
||||
],
|
||||
)
|
||||
|
13
timer_demo/timer.py
Normal file
13
timer_demo/timer.py
Normal 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()
|
Loading…
Reference in New Issue
Block a user