Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions server/recceiver/cf/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,17 +263,17 @@ def _apply_env_vars(
transaction: interfaces.ITransaction,
) -> None:
"""Append mapped EPICS environment variable properties to every record."""
for record_id in record_infos:
for epics_env_var_name, cf_prop_name in self.env_vars.items():
value = transaction.client_infos.get(epics_env_var_name)
if value is not None:
for epics_env_var_name, cf_prop_name in self.env_vars.items():
value = transaction.client_infos.get(epics_env_var_name)
if value is not None:
for record_id in record_infos:
record_infos[record_id].info_properties.append(CFProperty(cf_prop_name, ioc_info.owner, value))
else:
log.info(
"EPICS environment var %s not found in IOC: %s",
epics_env_var_name,
ioc_info,
)
else:
log.info(
"EPICS environment var %s not found in IOC: %s",
epics_env_var_name,
ioc_info,
)

@staticmethod
def record_info_by_name(record_infos: Dict[str, RecordInfo], ioc_info: IOCInfo) -> Dict[str, RecordInfo]:
Expand Down Expand Up @@ -612,7 +612,6 @@ def _process_new_channels(
)
new_properties = new_properties + record_info.info_properties
if channel_name in existing_channels:
log.info("update existing channel %s: exists but with a different iocid from %s", channel_name, iocid)
self._update_existing_channel_diff_iocid(
existing_channels, channel_name, new_properties, channels, record_info_by_name, ioc_info, iocid
)
Expand Down Expand Up @@ -816,7 +815,7 @@ def _update_existing_channel_diff_iocid(
self.managed_properties,
)
channels.append(existing_channel)
log.debug("Add existing channel with different IOC: %s", existing_channel)
log.debug("Add existing channel %s: exists but with a different iocid from %s", channel_name, iocid)
if self.cf_config.alias_enabled and channel_name in record_info_by_name:
alias_properties = [CFProperty(CFPropertyName.ALIAS.value, ioc_info.owner, channel_name)] + new_properties
for alias_name in record_info_by_name[channel_name].aliases:
Expand Down
3 changes: 2 additions & 1 deletion server/recceiver/recast.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,8 @@ def close(self):
# so that channels are registered as active in CF before the disconnect is processed.
# The disconnect transaction is chained after self._commit_chain and will execute
# once all preceding commits have finished.
self.transaction = Transaction(self.ep, id(self))
transaction, self.transaction = self.transaction, Transaction(self.ep, id(self))
self.transaction.client_infos = dict(transaction.client_infos)
self.transaction.connected = False
self.dirty = True
self.flush()
Expand Down
Loading