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
739ba7d9
Commit
739ba7d9
authored
4 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
TMSS-652
: do not import at top of file before django is configured
parent
76ad4252
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/TMSS/backend/services/tmss_postgres_listener/lib/tmss_postgres_listener.py
+5
-1
5 additions, 1 deletion
...ices/tmss_postgres_listener/lib/tmss_postgres_listener.py
with
5 additions
and
1 deletion
SAS/TMSS/backend/services/tmss_postgres_listener/lib/tmss_postgres_listener.py
+
5
−
1
View file @
739ba7d9
...
...
@@ -28,7 +28,6 @@ from lofar.messaging.messagebus import ToBus
from
lofar.sas.tmss.client.tmssbuslistener
import
*
from
lofar.common
import
dbcredentials
from
lofar.common.util
import
single_line_with_single_spaces
from
lofar.sas.tmss.tmss.tmssapp.models
import
Subtask
,
SchedulingUnitBlueprint
,
TaskBlueprint
from
distutils.util
import
strtobool
...
...
@@ -177,6 +176,7 @@ class TMSSPGListener(PostgresListener):
def
onSubTaskStateUpdated
(
self
,
payload
=
None
):
payload_dict
=
json
.
loads
(
payload
)
# send notification for this subtask...
from
lofar.sas.tmss.tmss.tmssapp.models
import
Subtask
subtask
=
Subtask
.
objects
.
get
(
id
=
payload_dict
[
'
id
'
])
self
.
_sendNotification
(
TMSS_SUBTASK_STATUS_EVENT_PREFIX
+
'
.
'
+
subtask
.
state
.
value
.
capitalize
(),
{
'
id
'
:
subtask
.
id
,
'
status
'
:
subtask
.
state
.
value
})
...
...
@@ -207,6 +207,8 @@ class TMSSPGListener(PostgresListener):
if
isinstance
(
payload
,
str
):
payload
=
json
.
loads
(
payload
)
from
lofar.sas.tmss.tmss.tmssapp.models
import
TaskBlueprint
task_blueprint
=
TaskBlueprint
.
objects
.
get
(
id
=
payload
[
'
id
'
])
self
.
_sendNotification
(
TMSS_SCHEDULINGUNITBLUEPRINT_OBJECT_EVENT_PREFIX
+
'
.Updated
'
,
{
'
id
'
:
task_blueprint
.
scheduling_unit_blueprint
.
id
})
...
...
@@ -227,6 +229,8 @@ class TMSSPGListener(PostgresListener):
if
isinstance
(
payload
,
str
):
payload
=
json
.
loads
(
payload
)
from
lofar.sas.tmss.tmss.tmssapp.models
import
SchedulingUnitBlueprint
scheduling_unit_blueprint
=
SchedulingUnitBlueprint
.
objects
.
get
(
id
=
payload
[
'
id
'
])
if
not
scheduling_unit_blueprint
.
can_proceed
:
...
...
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