def start_instance(self, instance): """Starts a given instance in a new process.""" instance.executor = self instance.save() self.log.info("Starting instance '%s'..." % instance) # p = Process(target=self.execute, args=[instance.start]) # p.start() ct = ContentType.objects.get_for_model(instance) p = Popen('norc_taskrunner --ct_pk %s --target_pk %s' % (ct.pk, instance.pk), shell=True) p.instance = instance self.processes[p.pid] = p
def start_instance(self, instance): """Starts a given instance in a new process.""" instance.executor = self instance.save() self.log.info("Starting %s..." % instance) # p = Process(target=self.execute, args=[instance.start]) # p.start() ct = ContentType.objects.get_for_model(instance) f = make_log(instance.log_path).file p = Popen('norc_taskrunner --ct_pk %s --target_pk %s' % (ct.pk, instance.pk), stdout=f, stderr=STDOUT, shell=True) p.instance = instance self.processes[p.pid] = p