Skip to content

Commit

Permalink
Avoid using unexisting command object
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Nov 17, 2024
1 parent c4b14f9 commit 175ecd8
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions python/lvmtan/BasdaMoccaBaseCluPythonServiceWorker.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ async def _stopMovement(self):
return await self._status(self.service.isReachable())

except Exception as e:
command.fail(error=e)
E_LOG(f"Exception: {e}")
raise


@command_parser.command("stop")
Expand All @@ -96,7 +97,7 @@ def _getPosition(self):
async def _status(self, reachable=True):
"""Status implementation"""
lock = asyncio.Lock()

async with lock:
age = (datetime.now() - self.statusCacheTimestamp).total_seconds()
if age > self.statusCacheAge:
Expand Down Expand Up @@ -133,7 +134,7 @@ async def _status(self, reachable=True):

except Exception as e:
E_LOG(f"Exception: {e}")
command.fail(error=e)
raise

return self.statusCacheData

Expand Down Expand Up @@ -241,6 +242,3 @@ async def chat(self, command: Command, card: int, com: int, module: int, select:

except Exception as e:
command.fail(error=e)



0 comments on commit 175ecd8

Please sign in to comment.