def setup_scheduling(self):
"Sets up regular job scheduling according to config"
# NOTE: This is locally imported because it will in turn import
# twistedsnmp. Twistedsnmp is stupid enough to call
# logging.basicConfig(). If imported before our own loginit, this
# causes us to have two StreamHandlers on the root logger, duplicating
# every log statement.
self._logger.info("Starting scheduling in single process")
from .schedule import JobScheduler
plugins.import_plugins()
self.work_pool = pool.InlinePool()
reactor.callWhenRunning(JobScheduler.initialize_from_config_and_run,
self.work_pool, self.options.onlyjob)
def log_scheduler_jobs():
JobScheduler.log_active_jobs(logging.INFO)
self.job_loggers.append(log_scheduler_jobs)
def reload_netboxes():
JobScheduler.reload()
self.reloaders.append(reload_netboxes)
评论列表
文章目录