Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
edb9352c
Commit
edb9352c
authored
7 years ago
by
Auke Klazema
Browse files
Options
Downloads
Patches
Plain Diff
Task #11032: Renamed function for readability
parent
5d8b9abe
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MAC/Services/TaskManagement/Server/lib/taskmanagement.py
+4
-4
4 additions, 4 deletions
MAC/Services/TaskManagement/Server/lib/taskmanagement.py
with
4 additions
and
4 deletions
MAC/Services/TaskManagement/Server/lib/taskmanagement.py
+
4
−
4
View file @
edb9352c
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment