Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
fecc41df41
1 changed files with 9 additions and 10 deletions
|
|
@ -117,7 +117,7 @@ def main():
|
||||||
exit()
|
exit()
|
||||||
|
|
||||||
scheduler = LinspectorScheduler({"apscheduler.threadpool.core_threads": args.corethreads,
|
scheduler = LinspectorScheduler({"apscheduler.threadpool.core_threads": args.corethreads,
|
||||||
"apscheduler.threadpool.max_threads": args.threads})
|
"apscheduler.threadpool.max_threads": args.threads})
|
||||||
|
|
||||||
TaskExecutor.Instance()
|
TaskExecutor.Instance()
|
||||||
|
|
||||||
|
|
@ -131,21 +131,19 @@ def main():
|
||||||
time_delta = 0
|
time_delta = 0
|
||||||
jobs = []
|
jobs = []
|
||||||
count = 0
|
count = 0
|
||||||
percent = 0
|
percent = float(0)
|
||||||
|
increment = float(100) / float(job_count )
|
||||||
for layout in lin_conf.get_enabled_layouts():
|
for layout in lin_conf.get_enabled_layouts():
|
||||||
for hostgroup in layout.get_hostgroups():
|
for hostgroup in layout.get_hostgroups():
|
||||||
for service in hostgroup.get_services():
|
for service in hostgroup.get_services():
|
||||||
for host in hostgroup.get_hosts():
|
for host in hostgroup.get_hosts():
|
||||||
for period in service.get_periods():
|
for period in service.get_periods():
|
||||||
count += 1
|
percent += increment
|
||||||
if job_count >= 100:
|
if percent >= count:
|
||||||
if count % (job_count/100) == 0:
|
sys.stdout.write("Scheduling jobs. Be patient... " + str(count) + "%\r")
|
||||||
percent += 1
|
|
||||||
sys.stdout.write("Scheduling jobs. Be patient... " + str(percent) + "%\r")
|
|
||||||
sys.stdout.flush()
|
|
||||||
else:
|
|
||||||
sys.stdout.write("Scheduling jobs. Be patient...\r")
|
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
while percent > count:
|
||||||
|
count += 1
|
||||||
|
|
||||||
time_delta += float(args.delay)
|
time_delta += float(args.delay)
|
||||||
new_start_date = start_date + datetime.timedelta(seconds=time_delta)
|
new_start_date = start_date + datetime.timedelta(seconds=time_delta)
|
||||||
|
|
@ -154,6 +152,7 @@ def main():
|
||||||
hostgroup.get_members(),
|
hostgroup.get_members(),
|
||||||
core,
|
core,
|
||||||
hostgroup)
|
hostgroup)
|
||||||
|
|
||||||
scheduler_job = period.createJob(scheduler, job, handle_job, start_date=new_start_date)
|
scheduler_job = period.createJob(scheduler, job, handle_job, start_date=new_start_date)
|
||||||
|
|
||||||
if scheduler_job is not None:
|
if scheduler_job is not None:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue