From 7bfe80fac72acc0faeb137a5d638a460ffcbc67e Mon Sep 17 00:00:00 2001 From: Davide Alberani Date: Tue, 16 Jan 2018 23:10:03 +0100 Subject: [PATCH] example of scheduling --- diffido.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/diffido.py b/diffido.py index e336360..94def18 100755 --- a/diffido.py +++ b/diffido.py @@ -98,10 +98,18 @@ class TemplateHandler(BaseHandler): self.render(page, **self.arguments) +def run_scheduled(id_=None, *args, **kwargs): + print('RUNNING %d' % id_) + +def run(): + print('runno!') + def serve(): jobstores = {'default': SQLAlchemyJobStore(url=JOBS_STORE)} scheduler = TornadoScheduler(jobstores=jobstores) scheduler.start() + scheduler.remove_job('run') + #scheduler.add_job(run, 'interval', minutes=1) define("port", default=3210, help="run on the given port", type=int) define("address", default='', help="bind the server at the given address", type=str)