>
>
> ---------- Forwarded message ----------
> From: mdipierro <[email protected]>
> Date: 22 sep, 18:48
> Subject: How to kick off process asynchronously
> To: web2py-users
>
>
> Spawning processes takes extra memory. If the user reloads the page
> too many time to soon get an out of memory.


Ok, catched

> I think it i better to
> have a single background process that handles tasks via a queue. It is
> described in the book chapter 4.
>
>

I've tried the example, but I have a problem with it: when the script
is run for the first time, it works perfectly,
but once it's inside the while loop, whenever it execute again the
rows =db(db.queue.status=='pending').select()
setence, it always returns the same value, i.e.: 0 after the first iteration.

I'm using mysql and web2py 1.85.3
It looks like the db connection is catched, because I've checked
(querying the database from a console) that the value changes, when I
add new rows to the queue with the pending tag.

In fact, I see that even
rows =db(db.queue.id>0).select()
always returns the first value when the script is initialized, no
matter how many rows I add to the queue table.

what am I missing?

Reply via email to