Skip to content

Commit

Permalink
Remove self.scheduler, it's only needed for signaling child tasks - u…
Browse files Browse the repository at this point in the history
…se the instance passed by hxtool_scheduler instead
  • Loading branch information
fe-ebroad committed Mar 18, 2021
1 parent 6f29080 commit 467e012
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions hxtool_scheduler_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def __init__(self, profile_id, name, task_id = None, start_time = None, end_time
self.profile_name = "Unknown"
self.task_id = task_id or str(secure_uuid4())
self.parent_id = parent_id
self.scheduler = None
self.wait_for_parent = wait_for_parent
self.parent_complete = False
self.name = name
Expand Down Expand Up @@ -144,8 +143,6 @@ def run(self, scheduler):

self.state = task_states.TASK_STATE_RUNNING

self.scheduler = scheduler

# Reset microseconds to keep from drifting too badly
self.last_run = datetime.datetime.utcnow().replace(microsecond=1)
# Clear this, otherwise the task view looks confusing
Expand Down Expand Up @@ -201,7 +198,7 @@ def run(self, scheduler):
self.state = task_states.TASK_STATE_COMPLETE

if not self.parent_id:
hxtool_global.hxtool_scheduler.signal_child_tasks(self.task_id, self.state, self.stored_result)
scheduler.signal_child_tasks(self.task_id, self.state, self.stored_result)

self._calculate_next_run()

Expand All @@ -212,7 +209,6 @@ def run(self, scheduler):
# Reset parent_complete for recurring tasks
self.parent_complete = False

self.scheduler = None
else:
self.set_state(task_states.TASK_STATE_STOPPED)

Expand Down

0 comments on commit 467e012

Please sign in to comment.