Some more scheduling config stuff in core/linspector.py.
This commit is contained in:
parent
36a2b62914
commit
118445404f
4 changed files with 26 additions and 9 deletions
|
|
@ -25,7 +25,7 @@ class Configuration:
|
|||
self.__configuration.read(configuration_path + '/linspector.conf', 'utf-8')
|
||||
except Exception as err:
|
||||
raise Exception('something went wrong reading the configuration file '
|
||||
'linspector.ini in the configuration root path! ({0})'.format(err))
|
||||
'linspector.conf in the configuration root path! ({0})'.format(err))
|
||||
else:
|
||||
raise FileNotFoundError("configuration file linspector.ini not found in configuration "
|
||||
"root path!")
|
||||
|
|
|
|||
|
|
@ -45,14 +45,25 @@ class Linspector:
|
|||
jobstores = {
|
||||
'memory': MemoryJobStore()
|
||||
}
|
||||
executors = {
|
||||
'default': ThreadPoolExecutor(int(configuration.get_option('linspector',
|
||||
'max_threads'))),
|
||||
#'default': ProcessPoolExecutor(int(configuration.get_option('linspector',
|
||||
# 'max_processes')))
|
||||
}
|
||||
if configuration.get_option('linspector', 'max_threads') and not \
|
||||
configuration.get_option('linspector', 'scheduler_mode') == 'process':
|
||||
executors = {
|
||||
'default': ThreadPoolExecutor(int(configuration.get_option('linspector',
|
||||
'max_threads')))
|
||||
}
|
||||
else:
|
||||
executors = {
|
||||
'default': ThreadPoolExecutor(1024)
|
||||
}
|
||||
if configuration.get_option('linspector', 'scheduler_mode'):
|
||||
if configuration.get_option('linspector', 'scheduler_mode') == 'process':
|
||||
executors = {
|
||||
'default': ProcessPoolExecutor(int(configuration.get_option('linspector',
|
||||
'max_processes')))
|
||||
}
|
||||
job_defaults = {
|
||||
'max_instances': 10000
|
||||
# every scheduler job (monitor) must only exist once.
|
||||
'max_instances': 1
|
||||
}
|
||||
self.__scheduler['linspector'] = BackgroundScheduler(jobstores=jobstores,
|
||||
executors=executors,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue