Skip to content

Commit

Permalink
(#117) (#45) only update elapsed time in status if not supplied
Browse files Browse the repository at this point in the history
  • Loading branch information
dperl-dls committed Apr 15, 2024
1 parent 7a5f3ee commit a6178dd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ophyd_async/core/async_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,10 @@ async def _notify_watchers_from(self, iterator: AsyncIterator[WatcherUpdate[T]])
async for update in iterator:
if self._timeout and time.monotonic() > self._timeout:
raise TimeoutError()
self._last_update = replace(
update, time_elapsed=time.monotonic() - self._start
self._last_update = (
update
if update.time_elapsed is None
else replace(update, time_elapsed=time.monotonic() - self._start)
)
for watcher in self._watchers:
self._update_watcher(watcher, self._last_update)
Expand Down

0 comments on commit a6178dd

Please sign in to comment.