Yes, in process_input_queue() I tried the first line just print 
db().select(db.input_queue.ALL). Result is nothing except the table headers.

I'm thinking there might be an issue in the server configuration, but why 
it should affect only standalone console-less web2py sessions and not the 
primary web2py server is currently a mystery to me.


On Monday, April 23, 2012 6:42:59 PM UTC+8, Niphlod wrote:
>
> aside from deleting the record using del (I'm thinking that that line is 
> not working), did you try simply printing the records , i.e :
>
> print db().select(db.input_queue.ALL)
>
> without doing anything ?
>
> It's pretty strange that for a db uri with sqlite that is working and for 
> a db uri with postgres is not....
>
> Il giorno lunedì 23 aprile 2012 04:47:04 UTC+2, weheh ha scritto:
>>
>> I'm running a background queue that does this:
>>
>> # this is myapp/private/input_queue.py
>> # -*- coding: utf-8 -*-
>> import time
>>
>>
>> while True:
>>     process_input_queue()
>>     time.sleep(10)
>>
>>
>> # model
>> def process_input_queue():
>>     """processes input_queue and deletes entry when done"""
>>     for qin in db().select(db.input_queue.ALL):
>>         # process input
>>         add_urls_to_mail_queue(qin)
>>         del db.input_queue[qin.id]
>>         db.commit()
>>
>> The queue gets launched like this:
>> python web2py.py -S dmca_enforcer -M -N -R applications/dmca_enforcer/
>> private/input_queue.py
>>
>> This works fine with sqlite. But postgres and mysql don't work. The 
>> problem is when I launch the queue on postgres or mysql, as per above (with 
>> or without the -N argument), the db().select(...) doesn't see anything in 
>> the db.input_queue table even though there are data in the table.
>>
>> Anybody have any ideas?
>>
>> I am not using the scheduler, yet, as my development work is on a windows 
>> box. But I'm deploying to an Ubuntu platform and am testing the scheulder 
>> there. So far, it seems to be behaving the same way ... seems to indicate 
>> there are no entries in the db.input_queue table, which is definitely *not* 
>> the case.
>>
>

Reply via email to