Skip to content
Snippets Groups Projects

Fix cleaning up event unsubscription maintenance

Merged Jan David Mol requested to merge L2SS-1258-fix-unsubscription into master
All threads resolved!
Files
3
@@ -137,9 +137,16 @@ class TemperatureManager(LOFARDevice):
super().configure_for_off()
# unsubscribe from all events
for dev_attr in self.temp_error_attrs.values():
dev_attr.proxy.unsubscribe_event(dev_attr.subscription_id)
del dev_attr
for attr_name in list(self.temp_error_attrs.keys()):
try:
dev_attr = self.temp_error_attrs[attr_name]
dev_attr.proxy.unsubscribe_event(dev_attr.subscription_id)
except Exception as e:
raise Exception(
f"Failed to unsubscribe from event regarding device {dev_attr.proxy.dev_name()} attribute {attr_name}"
) from e
finally:
del self.temp_error_attrs[attr_name]
is_alarming_R = attribute(
dtype=bool,
Loading