This could be a problem with

python2.5 web2py/web2py.py -a pass  &

try:

cd web2py

python2.5 web2py.py -a pass  &



On Feb 4, 3:05 pm, JonasR <jonas.rundb...@gmail.com> wrote:
> Hi
>
> I lift my hat off to mdipierro and all web2py contributors. I find it
> amazing.
>
> Here is a problem I have:
>
> I'm trying to spawn a post action task that needs to access the
> database.
> When my PostConnectionTask tries to access db I get an error:
> "ERROR:root:Callback execution failed for PostConnectionTask: Cannot
> operate on a closed database."
> So, obviously the task runs, but can't access the db somehow.
> If I run the same code as a normal action (controller) there is no
> problem.
>
> @service.jsonrpc
> def delete_all(app):
>
> gluon.contrib.wsgihooks.localposttasks.append( TestRunner( request,
> app ) )
>     return "ok"
>
> class TestRunner(PostConnectionTask):
>     def __init__(self, env, app):
>         PostConnectionTask.__init__(self, env)
>         self.application = app
>
>     def start(self):
>         db(db.queue.id>0).delete()
>
> Anyone with a clue why?
> The only documentation I've found (exept for source code)
> is from Achipa in this forum "-A New Cron (and post-connection tasks)"
>
> My config:
> Mac OS X 10.6.2
> staring web2py with: python2.5 web2py/web2py.py -a pass  &
> web2py Version 1.74.8 (source code)
> no cron jobs defined
>
> cheers
> Jonas

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

Reply via email to