Brian M
unread,Dec 28, 2011, 10:36:04 PM12/28/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web...@googlegroups.com
This is simply a note for anybody else who may come across this error when trying to run web2py's scheduler - it works just fine, provided you actually set it up in your code. (As great as web2py is, it is not psychic)
python web2py.py -K myapp
...
AttributeError: 'thread._local' object has no attribute '_scheduled'
If you get the error make sure you've actually imported the scheduler in one of your app's models.
from gluon.scheduler import Scheduler
myscheduler = Scheduler(db, dict(task_name = task_function))
I just wasted a bunch of time trying to figure out what was wrong only to finally realize that I was trying to run the scheduler against the wrong version of my app - one that I hadn't yet setup the scheduler in. DOH! I hope that sharing my foolishness here might save someone else a bit of frustration in the future. :)
~Brian