@guys......if you queue a task inside models, you're queuing a new task at every request ! ;-D
On Thursday, June 26, 2014 6:17:54 AM UTC+2, 黄祥 wrote: > > i've already tried, but got the same result + another strange output > during start web2py. here is the detail step i took. > 1. create new web2py app (copas the welcome folder and rename it into test) > 2. copas the scheduler.py into models (test\models\scheduler.py) > > *test\models\scheduler.py* > db.define_table('asdf', > Field('asdf'), > auth.signature ) > > from gluon.scheduler import Scheduler > > def demo1(): > db.asdf.insert(asdf = 'asdf') > db.commit() > > scheduler = Scheduler(db, tasks = dict(demo1 = demo1) ) > > scheduler.queue_task('demo1', prevent_drift = True, > repeats = 0, period = 5) > > 3. running from windows command prompt : > > cd C:\web2py > python web2py.py -K test -X > > 4. go to http://127.0.0.1:8000/test/appadmin/index and check the record > of table asdf, scheduler_task, scheduler_run and scheduler_worker > > no error traceback occured but the output is not expected for period of > the record created on table 'asdf' and had a lot of scheduler_task records > on the table. > another unexpected bonus is when running with the prevent_drift = True, > the command prompt is hung for the first time, so that i must terminate the > command line and then execute again, yet the prevent_drift = True result > for period is still not expected. > > thanks and best regards, > stifan > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.