Skip to content
Snippets Groups Projects
Commit edb9352c authored by Auke Klazema's avatar Auke Klazema
Browse files

Task #11032: Renamed function for readability

parent 5d8b9abe
No related branches found
No related tags found
No related merge requests found
...@@ -59,14 +59,14 @@ class TaskManagementHandler(MessageHandlerInterface): ...@@ -59,14 +59,14 @@ class TaskManagementHandler(MessageHandlerInterface):
:param otdb_id: :param otdb_id:
:return: dict with aborted key saying if aborting was succesful and otdb_id key :return: dict with aborted key saying if aborting was succesful and otdb_id key
""" """
if self._is_active_task(otdb_id): if self._is_active_observation(otdb_id):
aborted = self._abort_active_task(otdb_id) aborted = self._abort_active_observation(otdb_id)
else: else:
aborted = self._abort_inactive_task(otdb_id) aborted = self._abort_inactive_task(otdb_id)
return {"aborted": aborted, "otdb_id": otdb_id} return {"aborted": aborted, "otdb_id": otdb_id}
def _is_active_task(self, otdb_id): def _is_active_observation(self, otdb_id):
task_type, task_status = self._get_task_type_and_status(otdb_id) task_type, task_status = self._get_task_type_and_status(otdb_id)
return task_type == "observation" and (task_status == "running" or task_status == "queued") return task_type == "observation" and (task_status == "running" or task_status == "queued")
...@@ -81,7 +81,7 @@ class TaskManagementHandler(MessageHandlerInterface): ...@@ -81,7 +81,7 @@ class TaskManagementHandler(MessageHandlerInterface):
aborted = False aborted = False
return aborted return aborted
def _abort_active_task(self, otdb_id): def _abort_active_observation(self, otdb_id):
logger.info("Aborting active task: %s", otdb_id) logger.info("Aborting active task: %s", otdb_id)
result = self.obs_ctrl.abort_observation(otdb_id) result = self.obs_ctrl.abort_observation(otdb_id)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment