is there a commit in the functions? Functions executed in the scheduler 
environment are like the ones you use in the web2py shell: you have to 
manually commit them to save your results.

On Monday, October 29, 2012 2:59:22 PM UTC+1, Adi wrote:
>
> This simple insert into mongodb works fine when called from within same 
> application, but not when called from a scheduler on nginx, uwsgi, pymongo. 
> Scheduler reports task as COMPLETED and all other inserts into mysql from 
> the same function work well. 
>
> What's more interesting, same scheduler function works when I start a 
> scheduler locally on my mac. 
>
> Any hints what could I be doing wrong, please? Thanks.
>
> web2py - Version 2.2.1 (2012-10-21 16:57:04) stable
>
>
> from pymongo import Connection
> cn = Connection('localhost', 27017)
> db_m = cn.db    
>
> def testmongo():
>     usc = db_m.testcustomer
>     res = usc.insert({'name':'Test', 'dtt':request.now})
>     #... <--- other inserts (into mysql) work fine when called from 
> scheduler
>
>     return
>
>
>  

-- 



Reply via email to