ok. steps.

web2py.py -a yourpassword

go to /appname/test/queue_task

go to /appname/appadmin/select/db?query=db.scheduler_task.id>0

if nothing is there, then in controller test.py the function queue_task is 
not queuing the task.

if a single row is there, then, open a terminal and start the scheduler 
process with

web2py.py -K appname

wait 5 seconds, go to 
/appname/appadmin/select/db?query=db.scheduler_worker.id>0

if nothing is there, your worker process isn't actually working, or is 
unable to talk to the db.

if a single row is there, then it's working.

wait a few seconds, go 
to  /appname/appadmin/select/db?query=db.scheduler_task.id>0

check that the status turns to COMPLETED.

You can now go to  /appname/appadmin/select/db?query=db.asfd.id>0

to check for the record inserted by the task.

On Thursday, June 26, 2014 4:18:39 PM UTC+2, 黄祥 wrote:
>
> yeah, i realize that something i'm lacked off, unfortunately, i don't know 
> where is it. tried again using your code but still no luck 
> started from scratch
>
> *models\db_wizard_0.py*
> db.define_table('asdf',
>     Field('asdf'),
>     auth.signature )
>
> *models\scheduler.py*
> from gluon.scheduler import Scheduler
>
> def demo1():
>     db.asdf.insert(asdf = 'asdf')
>     db.commit()
>
> mysched = Scheduler(db, tasks = dict(demo1 = demo1) )
>
> *controlelrs\test.py*
> def queue_task():
>     mysched.queue_task('demo1')
> """
>     mysched.queue_task('demo1', prevent_drift = True, 
>                        repeats = 0, period = 5)
> """
>
> *command prompt*
> cd C:\web2py
> python web2py.py -K test -X
>
> checked the scheduler_task, scheduler_worker and asdf tables via appadmin.
>
> count to 5 or 10 and then refresh the scheduler_task, scheduler_worker and 
> asdf tables on appadmin.
>
> nothing happen
>
> i even created the scheduler_task manually from appadmin (
> http://127.0.0.1:8000/test/appadmin/insert/db/scheduler_task), but still 
> no luck (no error occured, but the scheduler didn't run). 
> execute the test controller (http://127.0.0.1:8000/test/test/queue_task) 
> got the same result.
> for testing purpose, i set the period = 5, so that, i don't have to long 
> waiting for the task execute by the scheduler.
>
> i'm running on windows 7 64 bit, with web2py latest source code version, 
> python 2.7.
>
> any idea, where is my mistake on code above or step i took to run the 
> scheduler?
>
> 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.

Reply via email to