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