Skip to content

Commit

Permalink
Merge branch 'master' into failed_task_capability
Browse files Browse the repository at this point in the history
  • Loading branch information
ThisIsClark authored Oct 19, 2021
2 parents 7f00b57 + b8de7c6 commit 4ff906c
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions delfin/task_manager/scheduler/schedulers/telemetry/job_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,19 @@ def schedule_job(self, task_id):

if not (existing_job_id and scheduler_job):
LOG.info('JobHandler scheduling a new job')
self.scheduler.add_job(
instance, 'interval', seconds=job['interval'],
next_run_time=next_collection_time, id=job_id,
misfire_grace_time=int(
CONF.telemetry.performance_collection_interval / 2))

update_task_dict = {'job_id': job_id
}
db.task_update(self.ctx, self.task_id, update_task_dict)
self.job_ids.add(job_id)
LOG.info('Periodic collection tasks scheduled for for job id: '
'%s ' % self.task_id)

if job['last_run_time']:
# Trigger one historic collection to make sure we do not
# miss any Data points due to reschedule
Expand All @@ -99,19 +112,6 @@ def schedule_job(self, task_id):

db.task_update(self.ctx, self.task_id,
{'last_run_time': last_run_time})

self.scheduler.add_job(
instance, 'interval', seconds=job['interval'],
next_run_time=next_collection_time, id=job_id,
misfire_grace_time=int(
CONF.telemetry.performance_collection_interval / 2))

update_task_dict = {'job_id': job_id
}
db.task_update(self.ctx, self.task_id, update_task_dict)
self.job_ids.add(job_id)
LOG.info('Periodic collection tasks scheduled for for job id: '
'%s ' % self.task_id)
else:
LOG.info('Job already exists with this scheduler')

Expand Down

0 comments on commit 4ff906c

Please sign in to comment.