From 38af7619c2c4166392d71a40ef9b24d0a1f354d2 Mon Sep 17 00:00:00 2001 From: BryantHe Date: Wed, 24 May 2023 00:39:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AE=9A=E6=97=B6=E5=99=A8?= =?UTF-8?q?=20demo=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup.py | 1 + timer_demo/timer.py | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 timer_demo/timer.py diff --git a/setup.py b/setup.py index eaf343a..ac664ce 100644 --- a/setup.py +++ b/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' ], ) diff --git a/timer_demo/timer.py b/timer_demo/timer.py new file mode 100644 index 0000000..238705a --- /dev/null +++ b/timer_demo/timer.py @@ -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() \ No newline at end of file