Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tango
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
tango
Commits
204baa25
Commit
204baa25
authored
1 year ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
Make sure attributes are polled when subscribing to them
parent
9606e7ea
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tangostationcontrol/tangostationcontrol/common/events.py
+3
-5
3 additions, 5 deletions
tangostationcontrol/tangostationcontrol/common/events.py
with
3 additions
and
5 deletions
tangostationcontrol/tangostationcontrol/common/events.py
+
3
−
5
View file @
204baa25
...
@@ -8,6 +8,7 @@ from prometheus_client import Counter
...
@@ -8,6 +8,7 @@ from prometheus_client import Counter
from
tango
import
DeviceProxy
,
EventType
from
tango
import
DeviceProxy
,
EventType
from
tangostationcontrol.common.lofar_logging
import
log_exceptions
from
tangostationcontrol.common.lofar_logging
import
log_exceptions
from
tangostationcontrol.common.constants
import
DEFAULT_POLLING_PERIOD_MS
from
tangostationcontrol.metrics
import
AttributeMetric
from
tangostationcontrol.metrics
import
AttributeMetric
logger
=
logging
.
getLogger
()
logger
=
logging
.
getLogger
()
...
@@ -87,11 +88,8 @@ class EventSubscriptions:
...
@@ -87,11 +88,8 @@ class EventSubscriptions:
# make sure the attribute is polled, otherwise we wont receive event
# make sure the attribute is polled, otherwise we wont receive event
if
not
proxy
.
is_attribute_polled
(
attr_name
):
if
not
proxy
.
is_attribute_polled
(
attr_name
):
logger
.
error
(
logger
.
info
(
f
"
Enabling polling for
{
proxy
.
name
()
}
/
{
attr_name
}
.
"
)
f
"
Error, no polling_period set for attribute
\
proxy
.
poll_attribute
(
attr_name
,
DEFAULT_POLLING_PERIOD_MS
)
{
proxy
.
name
()
}
/
{
attr_name
}
.
\
We will not get any events without a polling_period
"
)
# subscribe
# subscribe
event_id
=
proxy
.
subscribe_event
(
event_id
=
proxy
.
subscribe_event
(
...
...
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