Niphlod... you have full right to punch me :)
the problem was that the scheduler from other server was working all this
time, and mongo changes i introduced actually never kicked in (I counted on
scheduler running from this server)... Now, I'll hide for some time, while
re-arranging the "task calls a task" code, and so on :) Still have to say:
scheduler is great!
Sorry for false alarm...
On Monday, October 29, 2012 10:29:33 AM UTC-4, Niphlod 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
>>
>>
>>
>
>
--