Hello,
I am using a loop like this to wait for a scheduled task to complete:

        query = schdb.task_scheduled.id == id
        query &= ((schdb.task_scheduled.status == 'queued') |
(schdb.task_scheduled.status == 'running'))

        while schdb(query).count():
             time.sleep(0.1) #wait for task to run

This worked perfectly when schdb was on SQLite, but now I am using
MySQL so the workers can run on different machines. The loop goes on
forever. If I display the contents of schdb(query).select() in the
loop, I see that it does indeed continuously show the status is
'running'. However, when I look at the database with MysQL Query
Browser, I can see that the task completed normally and updated the
status to 'completed'. I checked to make sure there are no missing
db.commit() statements.

Any ideas what could be causing schdb(query) to not reflect the true
state of the database?

Thanks,
G

Reply via email to