fixed some multiprocessing stuff

This commit is contained in:
Johannes Findeisen 2013-12-10 02:42:36 +01:00
commit 259c6ee0f0
2 changed files with 9 additions and 2 deletions

View file

@ -130,7 +130,7 @@ def main():
process = LinspectorWorker(name, args.corethreads, args.threads)
workers.append(process)
process.daemon = True
process.start()
#process.start()
for worker in workers:
print "RESULT is %s" % worker.get_scheduler_name()
@ -166,6 +166,9 @@ def main():
if instance == args.instances:
instance = 0
for worker in workers:
worker.start()
print("\nScheduled " + str(job_count) + " jobs")
#TODO: add a list of workers and not only the last one; just a hack to make it run for testing

View file

@ -36,6 +36,10 @@ class LinspectorWorker(Process):
self.scheduler = LinspectorScheduler({"apscheduler.threadpool.core_threads": self.core_threads,
"apscheduler.threadpool.max_threads": self.max_threads})
self.scheduler.standalone = True
def run(self):
self.scheduler.start()
def handle_job(self, job):