added TaskExecutor into the job to execute tasks in its own Thread, and stops blocking the job

This commit is contained in:
RafTim 2013-11-09 02:20:20 +01:00
commit 1b089807bb
3 changed files with 7 additions and 10 deletions

View file

@ -35,6 +35,7 @@ from linspector.core.interface import LinspectorInterface
from linspector.core.job import Job
from linspector.core.scheduler import Scheduler
from linspector.frontends.lish import LishFrontend
from linspector.tasks.task import TaskExecutor
logger = logging.getLogger(__name__)
@ -120,6 +121,7 @@ def main():
scheduler = Scheduler({"apscheduler.threadpool.core_threads": args.corethreads,
"apscheduler.threadpool.max_threads": args.threads})
scheduler.start()
TaskExecutor.Instance()
start_date = datetime.datetime.now()
time_delta = 0
@ -156,6 +158,7 @@ def main():
logger.debug("shutting down scheduler")
shutdown_wait = True
if "shutdown_wait" in core:
shutdown_wait = core["shutdown_wait"]