Skip to content
Merged
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
13 changes: 13 additions & 0 deletions slac_timing/buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def _clear_ca_cache(self) -> None:
return

suffix = f"HST{self.number}"

stale_pvids = [
pvid for pvid in list(_PVcache_)
if pvid[0].endswith(suffix)
Expand All @@ -96,6 +97,18 @@ def _clear_ca_cache(self) -> None:
except BaseException:
pass

context_cache = epics.ca._cache.get(ctx)
if context_cache is None:
return
stale_names = [name for name in context_cache if name.endswith(suffix)]
for name in stale_names:
entry = context_cache.get(name)
if entry is not None and getattr(entry, "chid", None) is not None:
try:
epics.ca.clear_channel(entry.chid)
except BaseException:
context_cache.pop(name, None)

def is_reserved(self) -> bool:
return self.number is not None and self.number != 0

Expand Down
Loading