Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
zxdavb committed Aug 16, 2024
1 parent 9b38bc1 commit 421d9e5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ramses_rf/system/faultlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ async def get_faultlog(
if limit is None:
limit = DEFAULT_GET_LIMIT

self._is_getting = True
self._is_getting = True # TODO: semaphore?

# TODO: handle exc.RamsesException (RQ retries exceeded)
for idx in range(start, min(start + limit, self._MAX_LOG_IDX + 1)):
Expand All @@ -291,8 +291,8 @@ async def get_faultlog(
break
self._process_msg(Message(pkt)) # JIC dispatcher doesn't do this for us

self._is_current = False
self._is_getting = False
self._is_current = True

return self.faultlog

Expand All @@ -305,13 +305,14 @@ def faultlog(self) -> dict[FaultIdxT, FaultLogEntry]:

return {idx: self._log[dtm] for idx, dtm in self._map.items()}

def is_current(self, force_io: bool | None = None) -> bool: # TODO
async def is_current(self, force_io: bool = False) -> bool:
"""Return True if the local fault log is identical to the controllers.
If force_io, retrieve the 0th log entry and check it is identical to the local
copy.
"""

# if not self._is_current or not force_io: # TODO
return self._is_current

@property
Expand Down

0 comments on commit 421d9e5

Please sign in to comment.