fixed some multiprocessing stuff
This commit is contained in:
parent
0acb6402b0
commit
259c6ee0f0
2 changed files with 9 additions and 2 deletions
|
|
@ -130,7 +130,7 @@ def main():
|
||||||
process = LinspectorWorker(name, args.corethreads, args.threads)
|
process = LinspectorWorker(name, args.corethreads, args.threads)
|
||||||
workers.append(process)
|
workers.append(process)
|
||||||
process.daemon = True
|
process.daemon = True
|
||||||
process.start()
|
#process.start()
|
||||||
|
|
||||||
for worker in workers:
|
for worker in workers:
|
||||||
print "RESULT is %s" % worker.get_scheduler_name()
|
print "RESULT is %s" % worker.get_scheduler_name()
|
||||||
|
|
@ -166,6 +166,9 @@ def main():
|
||||||
if instance == args.instances:
|
if instance == args.instances:
|
||||||
instance = 0
|
instance = 0
|
||||||
|
|
||||||
|
for worker in workers:
|
||||||
|
worker.start()
|
||||||
|
|
||||||
print("\nScheduled " + str(job_count) + " jobs")
|
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
|
#TODO: add a list of workers and not only the last one; just a hack to make it run for testing
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,10 @@ class LinspectorWorker(Process):
|
||||||
|
|
||||||
self.scheduler = LinspectorScheduler({"apscheduler.threadpool.core_threads": self.core_threads,
|
self.scheduler = LinspectorScheduler({"apscheduler.threadpool.core_threads": self.core_threads,
|
||||||
"apscheduler.threadpool.max_threads": self.max_threads})
|
"apscheduler.threadpool.max_threads": self.max_threads})
|
||||||
|
|
||||||
|
self.scheduler.standalone = True
|
||||||
|
|
||||||
|
def run(self):
|
||||||
self.scheduler.start()
|
self.scheduler.start()
|
||||||
|
|
||||||
def handle_job(self, job):
|
def handle_job(self, job):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue