Skip to content
This repository has been archived by the owner on Oct 14, 2022. It is now read-only.

Commit

Permalink
fix ping
Browse files Browse the repository at this point in the history
  • Loading branch information
jordens committed Nov 12, 2018
1 parent db22513 commit d83566c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions highfinesse_net/protocol.py
@@ -1,4 +1,5 @@
import logging
import asyncio

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -67,8 +68,14 @@ async def get_version(self):
return [int(_) for _ in (await self.ask("getVersion")).split(",")]

async def ping(self):
""""""
return await self.get_version()
try:
await self.get_version()
except asyncio.CancelledError:
raise
except:
logger.warning("ping failed", exc_info=True)
return False
return True

async def get_calibration_wavelength(self, mode):
"""
Expand Down

0 comments on commit d83566c

Please sign in to comment.