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