Skip to content

Commit

Permalink
Do not auto-disable the IEB if connection fails
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Oct 15, 2022
1 parent 4348fb7 commit 559b176
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

* Add `FVCITER` keyword to the FVC process image header with the number of the FVC iteration.

### 🏷️ Changed

* `IEB` never disables itself automatically. Now it will try five times to connect to the WAGO module and if that fails it will issue an error but not self disable itself.

### 🔧 Fixed

* [#189](https://github.com/sdss/jaeger/issues/189) Prevent FPS initialisation from failing if a positioner is reporting a collided status.
Expand Down
18 changes: 9 additions & 9 deletions python/jaeger/ieb.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ async def __aenter__(self):
if self.disabled:
raise DriftError("IEB is disabled.")

try:
await Drift.__aenter__(self)
except DriftError:
self._n_failures += 1
if self._n_failures >= self.MAX_RETRIES:
self.disabled = True
raise DriftError("Failed connecting to the IEB. Disabling it.")
else:
raise DriftError("Failed connecting to the IEB.")
n_retries = 0
while True:
try:
await Drift.__aenter__(self)
break
except DriftError:
n_retries += 1
if n_retries >= 5:
raise DriftError("Failed connecting to the IEB.")

async def __aexit__(self, *args):

Expand Down

0 comments on commit 559b176

Please sign in to comment.