Skip to content

Commit f218649

Browse files
committed
refactor: switch around pv.post and op.done so setpoint is set before readback
1 parent 47e7858 commit f218649

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/fastcs/transports/epics/pva/_pv_handlers.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,15 @@ async def put(self, pv: SharedPV, op: ServerOperation):
4747
cast_value = cast_from_p4p_value(self._attr_w, raw_value)
4848

4949
tracer.log_event("PV put", topic=self._attr_w, pv=pv, value=cast_value)
50-
try:
51-
await self._attr_w.put(cast_value)
52-
op.done()
53-
except Exception as e:
54-
op.done(error=e)
50+
5551
if isinstance(self._attr_w.datatype, Enum):
5652
pv.post(cast_to_p4p_value(self._attr_w, cast_value))
5753
else:
5854
pv.post(value)
5955

56+
await self._attr_w.put(cast_value)
57+
op.done()
58+
6059

6160
class CommandPvHandler:
6261
def __init__(self, command: CommandCallback):

0 commit comments

Comments
 (0)