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)
|
||||
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
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
@ -56,4 +60,4 @@ class LinspectorWorker(Process):
|
|||
|
||||
if scheduler_job is not None:
|
||||
job.set_job(scheduler_job)
|
||||
jobs.append(job)
|
||||
jobs.append(job)
|
||||
Loading…
Add table
Add a link
Reference in a new issue