Ejemplo n.º 1
0
    def run(self):
        debug('RUN')

        # fix for some broken saved jobs
        for i, j in enumerate(self.jobs):
            if type(j) == str or type(j) == np.string_:
                self.jobs[i] = eval(j)

        # check to see if anything is left to do
        work_to_do = False
        for j in self.jobs:
            if j['status'] == 0 or j['status'] == 'Q':
                work_to_do = True
                break
        debug("WTD=%s" % work_to_do)
        if not work_to_do:
            return True

        # There is work to be done. Create a JobQueue and send stuff to it
        jobq = JobQueue(self, limit=self.qlimit)
        for j in self.jobs:
            if j['status'] == 0:
                debug("adding job %s" % j['num'])
                jobq.add(j)

        # Tell the JobQueue to start running jobs
        jobq.start()

        # join returns when JobQueue has run all the jobs
        res = jobq.join()
        if res == []:
            return True
        self.wqueue = res
        return False
Ejemplo n.º 2
0
Archivo: hosts.py Proyecto: zoidy/puq
 def run(self):
     jobq = JobQueue(self, limit=10, polltime=1)
     for j in self.jobs:
         if j['status'] == 0 or j['status'] == 'Q':
             debug("adding job %s" % j['num'])
             jobq.add(j)
     jobq.start()
     return jobq.join() == []
Ejemplo n.º 3
0
Archivo: hosts.py Proyecto: zoidy/puq
 def run(self):
     jobq = JobQueue(self, limit=10, polltime=1)
     for j in self.jobs:
         if j['status'] == 0 or j['status'] == 'Q':
             debug("adding job %s" % j['num'])
             jobq.add(j)
     jobq.start()
     return jobq.join() == []