yes, i had it for mysql and that worked fine, but my understanding is that mongodb doesn't have commit... but i'll look in that direction to see if there is something similar... Mind you, when I insert task from my local machine, document gets inserted into mongodb properly through scheduler.
On Mon, Oct 29, 2012 at 10:29 AM, Niphlod <[email protected]> wrote: > 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 >> >> >> > > -- > > > --

