PipelineFX Forum

Qube! => Developer Customization => Topic started by: jesse on July 16, 2008, 03:07:40 AM

Title: qube cleanup qb.remove
Post by: jesse on July 16, 2008, 03:07:40 AM
I am writing a python script to harvest data we might want before removing old jobs from qube.  jobinfo works quite fine to get at the data I need.

I then have used qb.remove() to remove the job. 

The job is no longer returned by qb.jobinfo, but it still appears in the gui.  Is there another step that I should be taking?

thanks
jesse

Code: [Select]
import sys
sys.path.append( "/usr/local/pfx/qube/api/python" )
import qb
import MySQLdb

conn = MySQLdb.connect ( host = "localhost", user = "...", passwd = "...", db = "...")
cursor = conn.cursor ()
jobInfos = qb.jobinfo([]);
for job in jobInfos:
    if job['timecomplete'] < time()-30*86400:
        sql = "INSERT ... "
        try:
            cursor.execute(sql)
            qb.remove(job['id'])
        except:
            print "Oopsies!",job['id']
cursor.close();
conn.close();
Title: Re: qube cleanup qb.remove
Post by: jesse on July 16, 2008, 03:50:32 AM
Woops,
I guess I was being impatient or the gui was not refreshing as I expected.
It seems everything is working as it should.
cheers,